Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

amm0124
Copy link

@amm0124 amm0124 commented Jan 30, 2025

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]>
Copy link
Contributor

@jzheaux jzheaux left a 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) {
Copy link
Contributor

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.

Copy link
Contributor

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;
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-triage An issue we've not yet triaged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants