Reputation: 7067
Been going through the examples on the spring website https://spring.io/guides/tutorials/spring-boot-oauth2/
I've made minimal changes to also allow google as a provider. However the authentication details format is different depending on the provider.
How can one tell given the Principal which provider it was authenticated against so that I can correctly read the information out of the Principal?
There doesn't seem to be any common way I can extract full name, email address and provider id out of all authentication providers.
Upvotes: 1
Views: 231
Reputation: 380
Use a custom successHandler that implements AuthenticationSuccessHandler, you'll get all the jwt info from the Authentication object.
Upvotes: 1