[keycloak-user] Facebook "picture" / additional scopes access

Scott Dunbar scott at xigole.com
Tue Jul 25 22:11:53 EDT 2017


Hi all,
I've not dealt with a Facebook integration in a while and am ultimately
trying to get the "picture" attribute of a Facebook user.  However, while I
see the code in
https://github.com/keycloak/keycloak/blob/2aa93d7d55869e3d262bef198e1059f42b7fa0f6/services/src/main/java/org/keycloak/social/facebook/FacebookIdentityProvider.java
that asks for some fields it is unclear how I add "picture" via the admin
console in "Identity Providers -> Facebook -> Default Scopes".  If I put
the word "picture" in "Default Scopes" I get an error from Facebook:

"Unsupported scope: 'picture'. Supported scopes: ads_management ads_read
email offline_access user_friends"

I've tried "public_profile" and, while it doesn't give an error, it does
not return what I'm looking for:

2017-07-25 20:06:27,595 DEBUG [org.keycloak.social.user_profile_dump]
(default task-84) User Profile JSON Data for provider facebook:
{"id":"1234567890","name":"Scott
Dunbar","first_name":"Scott","last_name":"Dunbar"}

I'm obviously missing something - how do I add some "scopes" to what is
requested from Facebook?

Thanks for any help.  I'll be doing the same for at least the Google
adapter next - any hints there?


-- 
Scott Dunbar


More information about the keycloak-user mailing list