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

AuthenticationEntryPoint commence Why is it executed twice #7776

Closed
h7asoka opened this issue Dec 29, 2019 · 2 comments
Closed

AuthenticationEntryPoint commence Why is it executed twice #7776

h7asoka opened this issue Dec 29, 2019 · 2 comments
Assignees
Labels
in: web An issue in web modules (web, webmvc)

Comments

@h7asoka
Copy link

h7asoka commented Dec 29, 2019

Summary

AuthenticationEntryPoint commence method Why is it executed twice

Actual Behavior

throw new UsernameNotFoundException , AuthenticationEntryPoint commence method Why is it executed twice

Expected Behavior

  1. throw new UsernameNotFoundException
  2. First AuthenticationEntryPoint commence method output UsernameNotFoundException message
  3. Then AuthenticationEntryPoint commence method output AuthenticationException message

Configuration

Version

spring-boot-starter-security 2.2.2.RELEASE

Sample

public class MyAuthenticationEntryPoint implements AuthenticationEntryPoint { @Override public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException e) throws IOException { String msg = Objects.nonNull(e) ? e.getMessage() : "Unauthorized"; response.sendError(HttpServletResponse.SC_UNAUTHORIZED, msg); } }

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Dec 29, 2019
@jzheaux
Copy link
Contributor

jzheaux commented Dec 30, 2019

Thanks for getting in touch, but it feels like this is a question that would be better suited to Stack Overflow. As mentioned in the guidelines for contributing, we prefer to use GitHub issues only for bugs and enhancements. Feel free to update this issue with a link to the re-posted question (so that other people can find it) or add more detail if you feel this is a genuine bug.

@jzheaux jzheaux closed this as completed Dec 30, 2019
@jzheaux jzheaux added in: web An issue in web modules (web, webmvc) and removed status: waiting-for-triage An issue we've not yet triaged labels Dec 30, 2019
@jzheaux jzheaux self-assigned this Dec 30, 2019
@bishwa-poudel
Copy link

Stucked in the same issue. @h7asoka have you found any fix to this?

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)
Projects
None yet
Development

No branches or pull requests

4 participants