Accessing SecurityIdentity::isAnonymous
without triggering HttpAuthenticationMechanism::authenticate
#34306
-
Is it possible to access Also, I disabled proactive authentication: |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments
-
/cc @sberyozkin (security) |
Beta Was this translation helpful? Give feedback.
-
@Eng-Fouad Can you clarify please what is happening with Perhaps you should keep the proactive authentication and make the resource totally public if you'd like it to be semi-secured, with the proactive authentication staying enabled. |
Beta Was this translation helpful? Give feedback.
-
@sberyozkin I have custom |
Beta Was this translation helpful? Give feedback.
-
@Eng-Fouad So your custom |
Beta Was this translation helpful? Give feedback.
-
This is my custom
I don't want it to be triggered for anonymous requests. |
Beta Was this translation helpful? Give feedback.
-
@Eng-Fouad Right, in that case, avoid blocking anonymous requests from it and throw your custom exception from the application code where you'd like to check if the identity is anonymous. Mechanisms throw |
Beta Was this translation helpful? Give feedback.
@Eng-Fouad Right, in that case, avoid blocking anonymous requests from it and throw your custom exception from the application code where you'd like to check if the identity is anonymous.
Mechanisms throw
AuthenticationFailedException
when the credentials can not be verified for the security runtime to request this mechanism to create a challenge. Mechanisms should return an empty or void Uni if no credentials are present - because other other authentication mechanism may be able to find the credentials.