Skip to content
This repository has been archived by the owner on Nov 16, 2018. It is now read-only.

Refreshing OAuth Bearer tokens #66

Open
jeremdow opened this issue Aug 15, 2017 · 0 comments
Open

Refreshing OAuth Bearer tokens #66

jeremdow opened this issue Aug 15, 2017 · 0 comments
Assignees

Comments

@jeremdow
Copy link

jeremdow commented Aug 15, 2017

I'm having an issue with waterwheel calls failing after the oauth access token has expired.

Request URL: /oauth/token
Request Method: POST
Status Code: 400 

{error: "invalid_grant",…}

"The provided authorization grant (e.g., authorization code, resource owner credentials) or refresh token is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client."

This may be a server issue related to d.o: #2894738 ?

But reviewing the documentation here, I noticed:

grant_type: The type of OAuth 2 grant. Currently password is the only supported value.

However, I was able to make calls via 'access_token' by making the following change:
jeremdow/waterwheel.js@9e51415

Then refresh the token(s) by switching the grant_type back to 'password' after expiration.

Without understanding the underlying issue better, this does prevent the above failure, and I believe(?) sets the proper grant_type for standard requests?

As it was, it seemed that a new refresh token (but not access token) was being returned by every request made via 'password' grant_type, which was only reset on refresh?

@mattgrill mattgrill self-assigned this Aug 15, 2017
@jeremdow jeremdow changed the title Refreshing oauth access tokens Refreshing OAuth Bearer tokens Aug 15, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants