Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do Facebook has a refresh token of OAuth?

Do Facebook has a refresh token of OAuth?

I wanna know if there is a refresh token, how long will it be expired? 60days?

And if Facebook don't have refresh token, then can I understand the long live access token as the refresh token, and short live access token as the access token?

Thanks.

like image 431
TK189 Avatar asked Jun 07 '16 08:06

TK189


People also ask

Does Facebook use OAuth?

OAuth is also used when giving third-party apps access to accounts like your Twitter, Facebook, Google, or Microsoft accounts. It allows these third-party apps access to parts of your account.

What token does Facebook use?

Page access tokens are used in Graph API calls to manage Facebook Pages. To generate a page access token, an admin of the page must grant your app the Page permission or permissions needed. Once granted, you can retrieve the Page access token using a user access token with the required permissions.

Does OAuth use refresh token?

OAuth 2.0 uses Access Tokens and Refresh Tokens. OpenID Connect (OIDC) is an identity protocol that performs user authentication, user consent, and token issuance.

What is OAuth authentication on Facebook?

OAuth, which is pronounced "oh-auth," enables an end user's account information to be used by third-party services, such as Facebook and Google, without exposing the user's account credentials to the third party.


1 Answers

Facebook does not provide a refresh token.

Facebook provides two kinds of access tokens,

  1. Short lived access token: A token that is expired after a short period of time (about 2 hours).

    Short lived access tokens are usually used on web clients.

  2. Long-lived access tokens: An access token which has a long life (about 60 days).

    Long lived access tokens are usually used on mobile apps and server side.

You can generate long lived access tokens with the Facebook SDKs for Android and iOs, These tokens will be refreshed once per day when the person using your app makes a request to Facebook's servers. If no requests are made, the token will expire after the preset expiry and the person will have to go through the login flow again to get a new token.

It is possible to exchange a valid short lived access token for a long lived access token.

The documentation explains well about the tokens, exchanging methods, call parameters etc..

And if Facebook don't have refresh token, then can I understand the long live access token as the refresh token, and short live access token as the access token?

No.You can't. Refresh token is a token that may be used to obtain a new access token.

Facebook SDKs can refresh an access token at regular intervals before token expiry if connected.

like image 145
All Іѕ Vаиітy Avatar answered Oct 22 '22 12:10

All Іѕ Vаиітy