简体   繁体   中英

iOS Facebook SDK access token

I am experimenting with an iOS app that utilize a REST API (ASP.NET MVC Web API) and I want users to be able to logon/register using either:

  • Username and password (default)
  • Facebook authentication

I have setup the iOS Facebook SDK and users can logon/register using it.

When a user register with Facebook, what access token should be used to bind it with the REST API account? AKFAccessToken or FBSDKAccessToken?

Haven´t found any tutorials where an iOS app and ASP.NET MVC Web API is combined. If anyone knows where I can find one that would help a lot.

If I am going at this problem completely wrong please correct me, I am still trying to wrap my head around it.

I will mention in details the best practice I know. The server have the facebook App ID (special ID for the app given from facebook when you register your new app). You send the FBSDKAccessToken for the server the server will encrypt the FBSDKAccessToken with the app id as a key and return to you the result named 'AccessKey'.

You save the accesskey and use it as a relation with the server from now on.

This way, no one can know the userFBID since u encrypted it and you didnt share your facebook app ID since it should be a secret.

Hope this helps!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM