SDITools / adobeanalyticsr

R Client for Adobe Analytics API v2.0
Other
18 stars 9 forks source link

Cannot regenerate token #94

Closed shannonhlo closed 3 years ago

shannonhlo commented 3 years ago

Hi, I'm trying to regenerate my authorization token after the initial one expired. Unfortunately I can't get the browser window to appear after running aw_token() as specified in the documentation here. I get the output below instead, but that doesn't help regenerate the authentication token. Am I missing something? adobe_api_error

shannonhlo commented 3 years ago

Additional note: I've ocnfirmed that the client ID and secret in the .Renviron file are correct

benrwoodard commented 3 years ago

Hey Shannon,
Unfortunately, Adobe hasn't enabled the use of the refresh token using oAuth even though it is part of the token. This means that there is some confusion in the authorization process when the token is expired. There are 2 basic ways to overcome this. The first is to simply delete the 'aa.oauth' file in your home directory and run aw_token() again. This will trigger the re-authorization dance again. The second way, my preferred way, is to simply run the get_me() function again after getting the 401 error. Most of the time this will also restart the oAuth dance.

shannonhlo commented 3 years ago

Thank you for the details Ben, I've refreshed the token successfully!