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

AbstractUserDetailsAuthenticationProvider should not swallow UsernameNotFoundException #16496

Open
jzheaux opened this issue Jan 28, 2025 · 6 comments
Assignees
Labels
in: web An issue in web modules (web, webmvc) type: enhancement A general enhancement

Comments

@jzheaux
Copy link
Contributor

jzheaux commented Jan 28, 2025

AbstractUserDetailsAuthenticationProvider catches UsernameNotFoundException, but does not include it when throwing BadCredentialsException.

Debugging would be improved if the stack trace included the original issue. This can be achieved by including the exception in the BadCredentialsException construction:

  // ...
} catch (UsernameNotFoundException ex) {
  // ...
  String message = this.messages
      .getMessage("AbstractUserDetailsAuthenticationProvider.badCredentials", "Bad credentials")
  throw new BadCredentialsException(message, ex);
}
@jzheaux jzheaux added in: web An issue in web modules (web, webmvc) status: first-timers-only An issue that can only be worked on by brand new contributors type: enhancement A general enhancement labels Jan 28, 2025
@kiruthiga1793
Copy link

Hi @jzheaux , I am interested in working on this issue. Can you please assign it to me?

@jzheaux jzheaux removed the status: first-timers-only An issue that can only be worked on by brand new contributors label Jan 31, 2025
@jzheaux
Copy link
Contributor Author

jzheaux commented Jan 31, 2025

For sure, @kiruthiga1793! I'm excited to work with you on this.

Even though it will likely be a small change, please take a moment to read our contribution guidelines.

@big-cir
Copy link
Contributor

big-cir commented Jan 31, 2025

I didn't see your assignment, sorry. Please close the pull request if you'd like.

@jzheaux
Copy link
Contributor Author

jzheaux commented Feb 3, 2025

no problem @big-cir, let's check.

@kiruthiga1793, a PR has recently been submitted for this ticket. However, since you were the first to volunteer, I want to double-check with you if you'd still like to contribute the PR for this ticket?

@big-cir
Copy link
Contributor

big-cir commented Feb 3, 2025

@jzheaux

Thank you for suggestion!  😊
I’m okay with either option, so please feel free to proceed in the way that works best for you. I respect your decision and will fully support it.

@kiruthiga1793
Copy link

Hi @jzheaux , If there are additional changes , I would like to contribute. Else, I don't want to waste the efforts of @big-cir

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web An issue in web modules (web, webmvc) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

3 participants