I am trying to get a filter to fire before the authentication service fires, it looks like the HTTP whiteboard is the way to go.
I've been following instructions here https://helpx.adobe.com/experience-manager/kt/platform-repository/using/osgi-http-whiteboard-code-sa... and here https://github.com/Adobe-Consulting-Services/acs-aem-samples/blob/master/bundle/src/main/java/com/ad....
i see the init and activate methods firing when I install my code but the doFilter method never fires. If I go to http://localhost:4502/system/console/httpwhiteboard I see theres nothing under registered filter service (not sure if this is expected or not)
My annotations on the class look like this:
@Component
@Properties({
@Property(name = HttpWhiteboardConstants.HTTP_WHITEBOARD_FILTER_REGEX,
value = { "/*"}),
@Property( name = HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_SELECT,
value = ("(" + HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_NAME + "=org.osgi.service.http)"
)
)
})
@Service
-------
Any thoughts? Ideas?
Solved! Go to Solution.
Views
Replies
Total Likes
Our eng member noticed that you were not following the example as is.
@Component
@Properties({
// A major difference from Sling Filters is Servlet Filters can be registered via the Felix HTTP Whiteboard to URL path patterns.
// A Pattern OR Regex must be provided.
@Property(name = HttpWhiteboardConstants.HTTP_WHITEBOARD_FILTER_PATTERN,
value = { "/content/samples/" }),
@Property(name = HttpWhiteboardConstants.HTTP_WHITEBOARD_FILTER_REGEX,
value = { "/[a-z]*" }),
@Property(name = HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_SELECT,
value = "(" + HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_NAME + "=*)")
})
@Service
Can you try to use this exact sample and see if its working for you.
Views
Replies
Total Likes
We are checking with the team that wrote the Github code.
Views
Replies
Total Likes
Our eng member noticed that you were not following the example as is.
@Component
@Properties({
// A major difference from Sling Filters is Servlet Filters can be registered via the Felix HTTP Whiteboard to URL path patterns.
// A Pattern OR Regex must be provided.
@Property(name = HttpWhiteboardConstants.HTTP_WHITEBOARD_FILTER_PATTERN,
value = { "/content/samples/" }),
@Property(name = HttpWhiteboardConstants.HTTP_WHITEBOARD_FILTER_REGEX,
value = { "/[a-z]*" }),
@Property(name = HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_SELECT,
value = "(" + HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_NAME + "=*)")
})
@Service
Can you try to use this exact sample and see if its working for you.
Views
Replies
Total Likes
Thanks! This appears to work.
I was confused in the git file where it said " // A Pattern OR Regex must be provided."so I thought we had to use one or the other
Views
Replies
Total Likes