I need to get current jackrabbit/session user when a request filter does filter. I've implemented filter class as my past question
Asked
Active
Viewed 255 times
0
1 Answers
1
From your previous question I assume you are using Apache Sling - if you follow my advice there and use a Sling-aware Filter, you can cast the request to SlingHttpServletRequest
in the filter's doFilter(...) method.
The SlingHttpServletRequest's
getResource()
method then provides the current Resource
, which you can adapt to a JCR Session
which then provides the Jackrabbit user.
Something like (without any checks for the example)
((SlingHttpServletRequest)request).getResource().getResourceResolver().adaptTo(Session.class)...

Community
- 1
- 1

Bertrand Delacretaz
- 6,100
- 19
- 24