I am trying to integrate with my Spring Boot app. I used the example provided here. When I swap out my creds in the auth0.properties and try to login I get an infinite loop back to the login. When I debug it appears this is happening here…
private void handle(HttpServletRequest req, HttpServletResponse res) throws IOException {
try {
Tokens tokens = controller.handle(req);
com.auth0.example.security.TokenAuthentication tokenAuth = new com.auth0.example.security.TokenAuthentication(JWT.decode(tokens.getIdToken()));
SecurityContextHolder.getContext().setAuthentication(tokenAuth);
res.sendRedirect(redirectOnSuccess);
} catch (AuthenticationException | IdentityVerificationException e) {
e.printStackTrace();
SecurityContextHolder.clearContext();
res.sendRedirect(redirectOnFail);
}
}
It seems to say…
com.auth0.exception.APIException: Request failed with status code 401: Unauthorized
I don’t get it do I need to delete and recreate my app? This was working at one point.