0

I don't know why I've got the different between the id from Facebook url and ProviderKey in the controller.

Here is my profile url: https://www.facebook.com/profile.php?id=100008491477935. So, my id is 100008491477935

But, when I use that account to login, the ProviderKey is not the same:

var loginInfo = await AuthenticationManager.GetExternalLoginInfoAsync();

loginInfo.Login.LoginProvider is 1488586148101087

I can get the picture from this url: https://graph.facebook.com/1488586148101087/picture

But, I've got error message Profile Unavailable when trying to go to https://www.facebook.com/profile.php?id=1488586148101087

The id is not correct (different from ProviderKey).

I wanna get user profile url by using ProviderKey like the id. Is there a way to do that?

Thank you!

1 Answers1

1

With the upgrade from Facebook Graph API v1.0 to v2.0, Facebook is using "App-scoped User IDs", so you cannot see the "original" user ID inside your apps anymore.

Refer to this Post(Question) for detailed answer.

Get Facebook User ID from app-scoped User ID

Good Luck

Community
  • 1
  • 1
Salman Aslam
  • 437
  • 3
  • 8
  • That mean: There is no way to get user profile url like `https://www.facebook.com/profile.php?id=xxx`, don't you? –  Oct 15 '15 at 12:43
  • As much as i know, you can get permitted user details from graph Api with app-scoped id but not complete profile in browser. – Salman Aslam Oct 15 '15 at 12:56
  • The `link` property of the user object will return a link of the form `https://www.facebook.com/app_scoped_user_id/{app-scoped id here}/` that you can use, it will automatically redirect to the actual user profile. – CBroe Oct 15 '15 at 13:46
  • This is not working anymore. – Suisse Oct 18 '21 at 16:21