-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Add authRequest field to AuthenticationException #16505
base: main
Are you sure you want to change the base?
Conversation
Store the authentication request details in the `authRequest` field of `AuthenticationException` when an authentication exception occurs. Closes spring-projectsgh-16444 Signed-off-by: amm0124 <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR, @amm0124! I've left some feedback inline.
this.authRequest = null; | ||
} | ||
|
||
public AuthenticationException(String msg, Authentication authRequest) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is an optional property, please add this as a setter. This also prevents a multiplicity of constructors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also please add @since 6.5
new public API components
|
||
public AuthenticationException(String msg, Authentication authRequest) { | ||
super(msg); | ||
this.authRequest = authRequest; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When provided, please ensure that authRequest
is not null.
authRequest
field ofAuthenticationException
when an authentication exception occurs.@rwinch