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

Make oauth2 tokens expiration time configurable #42738

Open
mickenordin opened this issue Jan 12, 2024 · 1 comment
Open

Make oauth2 tokens expiration time configurable #42738

mickenordin opened this issue Jan 12, 2024 · 1 comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap enhancement feature: authentication

Comments

@mickenordin
Copy link
Contributor

Currently access tokens that are given out by Nextcloud hard coded to be vaild for 3600 seconds: https://github.com/nextcloud/server/blob/48628b90690d8204e7875d561b8115c526cc9176/apps/oauth2/lib/Controller/OauthApiController.php#L203-L223C21

RFC 6750 states that: https://datatracker.ietf.org/doc/html/rfc6750#section-5.2

 To deal with token capture and replay, the following recommendations
   are made: First, the lifetime of the token MUST be limited; one means
   of achieving this is by putting a validity time field inside the
   protected part of the token.  Note that using short-lived (one hour
   or less) tokens reduces the impact of them being leaked.

Following these guidelines, a server administrator might want to reduce the validity of a token, to a shorter interval. Conversely, there may also be situations in which a server administrator may want to extend the expiration time of a token, following careful consideration of the impact of such a decision.

I therefore propose that we make the oauth2 access token validity time configurable. I am willing to submit a PR for this, if others think that this could be useful?

@mickenordin mickenordin added 0. Needs triage Pending check for reproducibility or if it fits our roadmap enhancement labels Jan 12, 2024
@joshtrichards
Copy link
Member

Related: #40766

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap enhancement feature: authentication
Projects
None yet
Development

No branches or pull requests

2 participants