How to get Google profile picture

Dear Team,
I have followed below configuration in keycloak console to get the profile picture from google. But picture attribute is not present in the output of keycloak object

keycloak version: 18.0.2
we are using keycloak-js with React

  1. Identity Providers → google→ Mappers Create

  2. Identity Providers → google→ Mappers → name = picture

  3. Identity Providers → google→ Mappers → Sync Mode Override = inherit

  4. Identity Providers → google→ Mappers → Mapper Type = Attribute Importer

  5. Identity Providers → google→ Mappers → Social Profile JSON Field Path = picture

  6. Identity Providers → google→ Mappers → User Attribute Name = picture

  7. Client → google→ Mappers Create

  8. Client → google→ Mappers → name = picture

  9. Client → google→ Mappers → Mapper Type = User Attribute

  10. Client → google→ Mappers → User Attribute= picture

  11. Client → google→ Mappers →Token Claim Name= picture

  12. Client → google→ Mappers →Claim JSON Type= string

  13. Client → google→ Mappers →Add to ID token = ON

  14. Client → google→ Mappers →Add to access token = ON

  15. Client → google→ Mappers →Add to userinfo = ON

let us know, if there is any other configuration changes missed as part of this setup.

Regards,
Prem

1 Like