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

Adding OAuth2 ROPC #676

Open
nwest1 opened this issue Feb 18, 2021 · 2 comments
Open

Adding OAuth2 ROPC #676

nwest1 opened this issue Feb 18, 2021 · 2 comments

Comments

@nwest1
Copy link
Contributor

nwest1 commented Feb 18, 2021

As of the current PR #674 - this works as expected except for when a token expires.

Looking to implement this part of the spec: https://tools.ietf.org/html/rfc6749#section-4.3

Because refresh tokens are optional (and internally, we don't implement them,) I'm not sure what the best strategy is to handle refreshing the whole thing.

The core library seems to take care of refreshing properly if a refresh token is available. If it isn't, we'd need to refresh to whole token and implement something to refresh the token based on expiration. Whether that's in /lib/util/http/client/type.go, /lib/util/http/auth/oauth2.go or elsewhere is tbd.

I'm going to experiment a bit with some of the options in the thread below and hope to arrive at something fruitful. Hoping to get your thoughts on where you prefer to see these changes. Does the current oauth2 client credentials work correctly for refreshing tokens?

Some discussion related:
golang/oauth2#84

Thanks again!

@nwest1
Copy link
Contributor Author

nwest1 commented Feb 18, 2021

I'm a bit hesitant to add any sort of caching / async refresh to this due to complexity in backoff strategies and concurrency. My gut is telling me to (when configured) check expiry before any httpclient.Do() and refresh the token if needed.

@Jeffail
Copy link
Collaborator

Jeffail commented Feb 19, 2021

Hey @nwest1, I'm a little out of my comfort zone with oauth2 algorithms but I'll try and read up on this soon.

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

No branches or pull requests

2 participants