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

Server extension to refresh OAuth token #3

Open
betatim opened this issue Jan 23, 2018 · 5 comments
Open

Server extension to refresh OAuth token #3

betatim opened this issue Jan 23, 2018 · 5 comments

Comments

@betatim
Copy link
Member

betatim commented Jan 23, 2018

Currently the only way to renew your token is to:

  1. stop server
  2. logout
  3. login
  4. start server

Pretty tedious. We should install a server extension that refreshes the token periodically so that it is always valid.

@betatim
Copy link
Member Author

betatim commented Jan 24, 2018

Random thought: is there a maximum time a token can be renewed? If yes we need a bit of UI glue to tell the user that they are out of time and need to perform above steps.

@madprime
Copy link
Collaborator

Not sure what the exact question is, but it looks like we're using the defaults from django-oauth-toolkit for token expiration. The access token will expire 10 hours after it's issued, and the refresh token never expires.

@betatim
Copy link
Member Author

betatim commented Jan 26, 2018

Ok. Sorry for the imprecise question. Your answer did contain the information I was looking for. Sounds like we can use the refresh token forever and ever to keep getting a new access token (that will be valid for the next ten hours).

@madprime
Copy link
Collaborator

Sorry, that's not entirely correct...

With our current configuration, refresh tokens have an indefinitely long lifetime – but they are rotated. That is to say: once a particular refresh token is used, it no longer possible to use it again. A successful refresh will return a new access token – and a new refresh token. Thus, the process of refresh can be repeated indefinitely, but each refresh token is single-use.

@betatim
Copy link
Member Author

betatim commented Feb 20, 2018

Thanks for explaining. I update both the auth and refresh token after getting a new one.

Work on this is happening in https://github.com/OpenHumans/jhoauth-refresh

Current state of the jhoauth-refresher is included in the custom image that #15 brings in.

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

2 participants