Search code examples
jsontokenasana

No refresh token


We are working on an interesting project with Asana API. We used the example in this link https://github.com/Asana/oauth-examples

Things work fine up to refresh token process. When we post refresh request, we get the below json. This json does not include refresh_token to reuse one hour later. Can you please let me know what to do?

response = RestClient.post "https://app.asana.com/-/oauth_token",
:grant_type => 'refresh_token',
:refresh_token => '0/61d875c01bbd97b0a0bd7b48ebc7a29b',
:client_id => '11111111111',
:client_secret => 'xxxxxxxxxxxxxx'
puts response.body

returns below

{                                                                                                                                                                         
  "access_token": "0/672d061b4b1357de257d7e598f571140",                                                                                                                   
  "token_type": "bearer",                                                                                                                                                 
  "expires_in": 3600,                                                                                                                                                     
  "data": {                                                                                                                                                               
    "id": 5165131262780,                                                                                                                                                  
    "name": "xxxx",                                                                                                                                               
    "email": "xxx@xxx.com"                                                                                                                               
  }                                                                                                                                                                       
} 

Solution

  • This confused me as well.

    You continue to use the same refresh token to obtain your next access token. No new refresh token is issued.