开发者

How could I authenticate a user in facebook using oauth?

I want to know how could I authentic开发者_运维知识库ate a user, visiting my site, for facebook using oAuth 2.0


You can use the javascript sdk.

Basically go here: http://developers.facebook.com/docs/reference/javascript/

Add the code to async load the fb all.js

Then authenticating can take many paths... you can do this:

http://developers.facebook.com/docs/reference/javascript/FB.login/

or pass them to here:

https://www.facebook.com/dialog/oauth? client_id=YOUR_APP_ID&redirect_uri=YOUR_URL

The you can make proper graph calls to get any necessary info you need with the graph like so:

FB.api('/me', function(response) { alert(response.name); });

Further information on that is available here: http://developers.facebook.com/docs/reference/javascript/FB.api/

Hope this helps.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜