简体   繁体   中英

How to specify expiry of token id Google log in?

Have read the article about expire of Google token id and as far as I understood, I have to get this value. When this value expired I have to refresh it.

But I didn't understand exactly this value is associated with web or android also?

According to the Google Doc. I should send request to Google api, retrieve token id and next send this token to my server side in order to verify it. And every next time concatenate this token with request to server side. But there are no words about life time of token.

In my mind this token some way have to refresh automatically.

According to documentation to project I have to get this expiry of token, but I can't figure out how I can get expiry time?

Google uses OAuth2 to act as authorization server for your app. You first sibmit your user/pass then it responds you with a refresh_token. Next level you return your refresh_token to obtain your access_token. Finally you send your access_token to your resource as a header to get your data. Normally refresh_token has a longer expiry than access_token. In google's case I think they are 2months for refresh_token and 15min for access_token. For more info you can take a look at : https://www.digitalocean.com/community/tutorials/an-introduction-to-oauth-2

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM