0
votes

I am using oauth2.0 api for LinkedIn share api.In that i am saving the access token with the expiry date.

By LinkedIn the access token will expiry in 60 days. So after that how to refresh the token before the access token expiry.

i used below url to implement the share api

http://developer.linkedin.com/documents/share-api

1

1 Answers

0
votes

When you get your access token from LinkedIn during the OAuth 2.0 flow, you will also be passed a parameter called expires_in which is the number of seconds until the token will expire.

If you track that value and know that you are nearing the token's expiry date before you attempt to use it, you can invisibly refresh the token without requiring any specific user interaction by simply sending the user through the authorization process again.

The authentication dialog box will be suppressed provided:

  1. the user is still logged into linkedin.com, and
  2. the token has not yet expired

See additional documentation here: https://developer.linkedin.com/docs/oauth2#refresh