Expand my Community achievements bar.

SOLVED

Getting same refresh token

Avatar

Level 1

We are trying to get new refresh_token and access_token using existing refresh_token. Every time it returns the same refresh_token but less validity left. After sometime refresh_token will be not valid anymore.

Can someone suggest how to generate new refresh_token with more validity.

 

Note :- We have scheduled job which runs every 12hrs to generate new refresh_token and access_token using existing refresh_token

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Employee
Employee

Yep - that's true. The Analytics API does not support offline_access scope yet. So your app would not be able to refresh access tokens for more than 14 days and would need the user to log in again. 

View solution in original post

11 Replies

Avatar

Employee
Employee

Hi @Kumar1 

 

Did you create your project recently (to be exact: did you add the OAuth credential recently to your project)?

If not, I'd recommend deleting the current OAuth credential from your project and re-adding the API to get a new OAuth credential. We have made a host of improvements to refresh tokens in the new credential which avoids problems like the one you are seeing. 

 

Let me know if this still does not work for you.

Happy to help

Thanks,
Manik

Avatar

Level 1

Hi Manik,

 

I created the new project and used newly generated OAuth credentials to fetch fresh set of access_token and refresh_token but it is still repeatedly returning the same refresh_token .

Avatar

Employee
Employee

@Kumar1 I checked with our internal team - that is not a problem - we reuse the same refresh token for 7 days (as it expires in 14 days). Post 7 days, our OAuth servers will return you a new refresh token. So the effect to watch out for is not whether refresh tokens are same or not, but whether your app is able to refresh access tokens indefinitely. 

 

Also, one thing probably worth verifying is whether your API has the offline access scope available. To do this, go to your project on the Developer Console, on the sidenav pick the OAuth credential you are using and then click on the scopes tab to see the list of scopes added to your client id. 

 

Let me know if this still does not work for you. 

Happy to help.

Avatar

Level 1

Hi @tmj ,

 

I verified the API and the offline access scope is not there.

Could you please suggest how can I add offline scope to my API ?

Avatar

Employee
Employee

@Kumar1 the offline_access scope depends on whether the API Supports it or not. Which API are you working with? 

Avatar

Level 1

@tmj We are using Adobe Analytics API's and I don't think it support offline_scope.

Avatar

Correct answer by
Employee
Employee

Yep - that's true. The Analytics API does not support offline_access scope yet. So your app would not be able to refresh access tokens for more than 14 days and would need the user to log in again. 

Avatar

Level 1

@tmj  Is there any way to handle this scenario ? Currently we have to manually regenerate the token from postman and feed it into our application after every 14 days.

Avatar

Employee
Employee

If it is an application you folks own, do you know if you can you the Service Account (JWT) credential to call the same APIs instead of the OAuth credential? 

I'd suggest trying that approach or reaching out to the Analytics Team here: https://experienceleaguecommunities.adobe.com/t5/adobe-analytics/ct-p/adobe-analytics-community 

Avatar

Level 1

Hi @tmj ,

 

I have raise this issue with Adobe support team and they are looking into this.

Meanwhile I will try to implement the (JWT) credential.

Thank you for you help

Avatar

Level 1

Is this still the case?  (API 1.4)   If so, does the Analytics API 2.0 support this?  We need to automate refreshes without user intervention.