Facebook C# SDK - Server flow authentication

孤街醉人 提交于 2019-12-03 07:53:17

Server side authentication is same as client side, you redirect user to OAuth Dialog with parameters like RedirectUri and you AppId. Then user is redirected to RedirectUri with parameter code and now you make server side request to convert code to access token, thats all.

Read Doc for Server-Side Authentication on http://developers.facebook.com/docs/authentication/server-side/

How to exchange the code for a User Access Token with Facebook C# SDK?

var fb = new FacebookClient();
dynamic response = fb.Get("oauth/access_token", 
        new
        { 
            client_id = APP_ID,
            redirect_uri = "http://www.example.com/",
            client_secret = SECRET_ID,
            code = CODE
        })
//response.access_token
//response.expires

var fb = new FacebookClient(); dynamic signedRequest = fb.ParseSignedRequest("app_secret", Request.Params["signed_request"]);

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!