开发者

Does Facebook actually support OAuth 2.0?

开发者 https://www.devze.com 2023-04-09 19:52 出处:网络
I\'ve already succesfully implemented LinkedIn and Twitter Oauth 2.0 authorization in my App with external libraries. But I have problems with Facebook. It seems like it has different authorization fl

I've already succesfully implemented LinkedIn and Twitter Oauth 2.0 authorization in my App with external libraries. But I have problems with Facebook. It seems like it has different authorization flow.

I need to have 3 endpoints to implement OAuth: request token url, access token url and authorize token url.

For LinkedIn and Twitter I have them:

REQ_TOKEN_URL="https://api.linkedin.com/uas/oauth/requestToken";
ACCESS_TOKEN_URL="https://api.linkedin.com/uas/oauth/accessToken";
AUTHORIZE_TOKEN_URL="https://api.linkedin.com/uas/oauth/authorize";

REQ_T开发者_Go百科OKEN_URL="https://api.twitter.com/oauth/request_token";
ACCESS_TOKEN_URL="https://api.twitter.com/oauth/access_token";
AUTHORIZE_TOKEN_URL="https://api.twitter.com/oauth/authorize";

But for Facebook instead of request token I have

OAUTH_FACEBOOK_DIALOG = "https://www.facebook.com/dialog/oauth";

And I'm not sure if it's equal. Probably not, since it doen's work the way it did with LinedIn and Twitter.

And in Facebook documentation they suggest to start with redirecting user to "https://www.facebook.com/dialog/oauth", but in classical OAuth 2.0 first I have to request the token from request_token_URL.

So the question is: is Facebook authorization flow actually not OAuth 2.0 and I have to use different approach?


Facebook does in fact fully support OAuth 2.0. Twitter currently does not support OAuth 2.0. LinkedIn OAuth 2.0 support I believe is still in beta. But yes, you will need to use a different approach for different versions of OAuth.

0

精彩评论

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