开发者

where should i save accesstoken in mvc other than session

开发者 https://www.devze.com 2023-02-20 05:20 出处:网络
As we all know one big advantage of MVC is stateless. However if not using session, wher开发者_JS百科e should I save my accesstoken from facebook.

As we all know one big advantage of MVC is stateless.

However if not using session, wher开发者_JS百科e should I save my accesstoken from facebook. since i want user to be able to post feed to their wall, which requires accesstoken for authentication.

Is there any best practice that i can follow?

thanks


I end up save fb accessToken in my database by requiring user facebook extended permission: offline_access

I dont know how to delete the question, so I put my solution up here.


See the StoreFacebookAuthToken method in this site.

I changed the code a bit and summarizing looked like this:

  1. Add Identity Claim Facebook:access_token on OnAuthenticated event
  2. Create a method to store the claim in database
  3. Call the created method from ExternalLoginCallback, LinkLoginCallBack and ExternalLoginConfirmation Actions

See the code here.

0

精彩评论

暂无评论...
验证码 换一张
取 消