Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expired OAuth details being restored by getStoredCredentials() #13

Closed
FishOfPrey opened this issue Mar 20, 2018 · 4 comments
Closed

Expired OAuth details being restored by getStoredCredentials() #13

FishOfPrey opened this issue Mar 20, 2018 · 4 comments
Assignees

Comments

@FishOfPrey
Copy link

I tried to restart my Fridge project after a couple of weeks of inactivity to do some modifications.
The Agent code started failing with the error message:

ERROR: [ { "message": "Session expired or invalid", "errorCode": "INVALID_SESSION_ID" } ]

I logged the access_token, and it was indeed expired. From my reading of getStoredCredentials() and getOAuthToken(...) the oAuth details are persisted as a Squirrel table. This seems problematic, as the access_token expires and needs to be updated using a refresh token periodically.

I initially tried adding a server.save({}); immediately after the server.error on line 204. However, that didn't restart to OAuth process to get a valid access_token.

Seems I also needed to browse to the Agent URL to complete the OAuth steps again.

Failing using the refresh_token, is there a way to clear out the existing expired OAuth details and indicate that the agent URL needs to be browsed to?

@PadmanPL
Copy link

PadmanPL commented Oct 3, 2018

Have you had your issue solved? I am facing the same problem

@ppetrosh ppetrosh self-assigned this Oct 8, 2018
@ppetrosh
Copy link
Contributor

I am looking into this. I will update the ticket with the results of my investigation and the suggestions.

@ppetrosh ppetrosh mentioned this issue Oct 16, 2018
@ppetrosh
Copy link
Contributor

What I found is that refresh token has never been used in the library/examples. So I added update of access token into the smart refrig example. I haven't fully tested it yet, but you should get the idea.

@ppetrosh
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants