Azure-Samples / ms-identity-java-webapp

A Java web application calling Microsoft graph that is secured using the Microsoft identity platform
MIT License
118 stars 105 forks source link

Not able to fetch username in spring sample #79

Closed nileshbhise closed 3 years ago

nileshbhise commented 3 years ago

Tried to run Spring sample on my localhost. No matter what user I use to log in as, secure_page always shows logged in as "unknown" user. what am I doing wrong? unknown

Avery-Dunn commented 3 years ago

Hello @nileshbhise : I haven't seen this issue before, and haven't been able to reproduce it myself.

Could you post some of the logs from when you run the sample? Are you seeing any errors in the logs? I just ran the sample myself and there should be a line similar to this:

Authentication success. Updating SecurityContextHolder to contain: org.springframework.security.oauth2.provider.OAuth2Authentication@ccc99920: Principal: Avery Dunn; Credentials: [PROTECTED]; Authenticated: true; ...

Avery-Dunn commented 3 years ago

Closing due to inactivity. If you're still having issues or have any related questions, feel free to re-open or leave comment.