-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
More complete SecurityEvents #40170
Comments
/cc @sberyozkin (security) |
@sberyozkin : Do you have an opinion on this enhancement proposal? |
We don't have the identity available when proactivate authentication is disabled and permit all check is used because the authentication is not required. However when the proactivate authentication is enabled, we can do that. Reason why is it not there is just an implementation detail (basically we use deferred identity in these parts of the code, so we would need to take it from the event instead if and only if proactive=true).
Basically the issue is that security checks on CDI beans (not resources) are performed in Quarkus Security extension that has no knowledge of Vert.x, therefore it doesn't know about the With that said, I am glad you reported and I don't say you are wrong. Thanks! |
Hello @michalvavrik , thank you for your reply. Could you clarify this statement for me?
Does that mean that you could do it, but don't do it currently? Apparently, it is not done, since I get an authentication event with the correct principal, but the AuthorizationSuccessEvent has no SecurityIdentity. |
Yes. It's fairly easy to fix. There was a technical reason why I didn't do it at first (I tried to give background to that decision above), but you are right, it belongs there when proactive auth is enabled. |
Thanks for confirming. Regarding the second question, you wrote
It looks like the |
During the review of the PR that added these Security events, some reviewers had doubts whether these kind of information are useful to users. We basically thought that user feedback will be best to determine what is it that should be in the event attributes :-). So I take it you would like there:
If I get it right, sure I agree, though others might have other opinions (cc @sberyozkin ). I'll propose this in the PR and let see how it goes. the most tricky part if this issue that you opened is adding
@mrickly if you can agree that we will just document how you get RoutingContext then I'll address it. Any complains or other questions? Shoot! |
@michalvavrik : To summarize what we would like:
I am not sure that we need the routing context at all cost (if the method name is available instead). In any case, none of the two options seem to work currently for a |
Knowing the implementation details this is hard to believe. I'll try to reproduce it but openly I'm quite busy ATM. I suppose you don't have a reproducer (some code I could run or look into?) These things implemented differently based on REST stack and config you use (Quarkus REST vs RESTEasy Classic, proactive auth enabled / disabled). If you had a repro, I could promise to look this week. |
sounds reasonable to me
I'm not sure TBH, there would be a cost and you can use method reference to look this up. On the other hand it sounds very user friendly from Quarkus to say: here is failed security check method and required roles while here is your identity that is missing these roles. We can let others to comment on this and decide based on the feedback? Can you provide insight why is it useful to you when you have method reference, are you going to export it or something like that? |
I agree that the I will try to provide a minimal reproducer for my claim today or tomorrow. |
oki, thanks for the insight
thank you (I can probably deal with non-minimal if it was for some reason hard :-)) |
quarkus-40170-reproducer.zip
|
thanks @mrickly ,
okay so it seems that async observer is activated with a brand new CDI request context which is not pre-populated with the
I believe this is |
Description
I have noticed the following when using SecurityEvents:
AuthorizationSuccessEvent
is fired when a REST resource or method annotated with@PermitAll
is called. However theSecurityIdentity
of that event isnull
. I'd rather know theSecurityIdentity
even in that case.AuthorizationSuccessEvent
orAuthorizationFailureEvent
fired has notRoutingContext
. It would be nice to have a way to determine the method.Implementation ideas
No response
The text was updated successfully, but these errors were encountered: