0

I am enabling social login (Google, Facebook, Twitter) in my java ee application and authenticate through Keycloak. So far I have been able to authenticate the application directly through Keycloak and I am capturing the AccessToken with the below methodology:

AccessToken accessToken = ((KeycloakPrincipal) httpRequest.getUserPrincipal()).getKeycloakSecurityContext().getToken();

Can I use this access token to identify the Identity Provider(Google/Facebook/Twitter) through which the User has logged in? My basic requirement is to find out the Identity Provider through which the user has logged in?

whywake
  • 880
  • 10
  • 29

1 Answers1

0

The access token contains field iss. That is an issuer - identifies principal that issued the JWT = used Identity Provider.

Jan Garaj
  • 25,598
  • 3
  • 38
  • 59
  • The issuer is showing the url where the keycloak server is hosted and not the identity provider – whywake Sep 28 '17 at 04:29