Welcome to the new Box Support website. Check out all the details here on what’s changed.

Refresh Token Issue in Node js SDK

Answered
New post

Comments

1 comment

  • Nayak

    Hi , answering your concerns one by one:

    1. The access token is only valid for 1 hour from the time of issue,

    2. The authorization code should be valid for 30seconds so that you have ample time to do the token call and get a access token and refresh token

    3. To avoid step #2, you can store the refresh token and use the same to get a new access token every time the access token expires (do remember with every token call as shown below, current refresh token expires and a new refresh token is responded back by the server for future use) Refer Link for further details

    curl -X POST https://api.box.com/oauth2/token \
         -H 'Content-Type: application/x-www-form-urlencoded' \
         -d 'client_id=[CLIENT_ID]' \
         -d 'client_secret=[CLIENT_SECRET]' \
         -d 'refresh_token=[REFRESH_TOKEN]' \
         -d 'grant_type=refresh_token'

     

    0
    Comment actions Permalink

Please sign in to leave a comment.