How do I get user details in controller of Spring Boot OIDC app?
I have adapted the code from here to call a MitreID OIDC server. My controller: public final String home(Principal p) { final String username = SecurityContextHolder.getContext().getAuthentication().getName(); ... returns null and is null for all userdetails. I have also tried: public final String home(@AuthenticationPrincipal OpenIdConnectUserDetails user) { final String username = user.getUsername(); and @RequestMapping(value = "/username", method = RequestMethod.GET) @ResponseBody public String currentUserNameSimple(HttpServletRequest request) { Principal principal = request.getUserPrincipa
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.