-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Alternative mechanism of obtaining of CommonProfile and ProfileManager #32
Comments
You are right on point :) I was exactly in the process of moving everything pac4j-related that could be accessed during a request to the jax-rs It is maybe a better idea to do this now and not wait for pac4j 3 actually (while staying backward compatible with present functionalities until the move to pac4j 3). |
Hm, it's not so easy because of the way pac4j currently work: basically, the big problem is that I'm not able to know if I should look for the profiles into the session or not so I cannot construct a This is fixed in pac4j 3 and that's why it was natural to do it at that point. Do you need this feature or was it just an desirable enhancement? Can it wait for pac4j 3 (few months)? |
Actually I found an interesting alternative. Do you think we should get access to the |
Oh great to know you are working on this already! I can get my job done with current annotations and my proposal is just, yes, a desirable enhancement :) Moreover, I have already tried to implement what I was talking about for RestEasy. I was almost done with implementation but at the end it turned out that ReatEasy injects See this line: ContextParameterInjector.java:38 |
Re: |
This means you can't cast the |
Yes, you can't cast |
Yep, good idea, there are maybe other ways to handle that situation... |
Actually, Jersey neither inject directly the
|
- deprecate the need to specify if the profile should be retrived from session - use the SecurityContext as the source of information: JaxRsContext and profiles can be accessed from it now - simplify code and refactor a bit - improve reasteasy injection and add author information - bump to 2.2.0 Closes pac4j#32
I have checked #33 and everything looks good to me. |
thanks :) |
Per jax-rs spec there is
SecurityContext
, which can be injected into a resource with@Context
annotation and pac4j-jaxrs already has it's own implementation ofSecurityContext
, which isJaxRsProfileManager.Pac4JSecurityContext
. TheSecurityContext
class is a native way of providing security features to a resource, so I was wondering whether it is possible to add a method toPac4JSecurityContext
like.getProfileManager()
(and also.getProfile()
toPrincipalImpl
) which would returnProfileManager
(andCommonProfile
). The only thing a resource would be required to do is to castSecurityContext
toPac4JSecurityContext
. What do you think?The text was updated successfully, but these errors were encountered: