-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Customizable TTL per OAuth2 Client #3157
Comments
Implementation is a bit weird and needs to be tested as this feature has taken a back seat for a long time. Basically, we'll need to add some code around Line 638 in 3f96276 which would be something along the lines of:
This of course needs testing in Additionally, we'll need some SQL migrations to add these new keys to the OAuth2 Client's database model that also need to be tested and backported to the v2.x branch. Lastly, this needs e2e tests which cover the functionality already tested in the integration tests in the oauth2 package. This is the last sanity check that everything works e2e. Finally, this has to be documented and announced (/cc @kmherrmann ). |
Potentially related: https://github.com/ory/fosite/pull/656/files |
You can also play around with it in fosite itself first here: https://github.com/ory/fosite-example/blob/master/authorizationserver/oauth2_token.go |
The client migrations in 1.x needs to be backdated so it ends up in the correct order in v2.x |
Note to self: make sure to backdate the migrations before 2.x migrations |
Hi @aeneasr @piotrmsc . I had a look at fosite and Hydra's usage of it, and this is the simplest solution I could find. Please let me know what you think. Customizable TTL per OAuth2 client implementation: Fosite
Hydra
|
Great analysis, sounds good @grantzvolsky ! |
This change introduces a new endpoint that allows you to control how long client tokens last. Now you can configure the lifespan for each valid combination of Client, GrantType, and TokenType. Part of #3157
This change introduces a new endpoint that allows you to control how long client tokens last. Now you can configure the lifespan for each valid combination of Client, GrantType, and TokenType. Part of #3157
This change introduces a new endpoint that allows you to control how long client tokens last. Now you can configure the lifespan for each valid combination of Client, GrantType, and TokenType. See #3157 Co-authored-by: aeneasr <[email protected]> Co-authored-by: Andreas Bucksteeg <[email protected]>
This change introduces the ability to control the lifespan of tokens for each valid combination of Client, GrantType, and TokenType. Part of ory/hydra#3157
This change introduces a new endpoint that allows you to control how long client tokens last. Now you can configure the lifespan for each valid combination of Client, GrantType, and TokenType. See #3157 Co-authored-by: aeneasr <[email protected]> Co-authored-by: Andreas Bucksteeg <[email protected]>
This change introduces a new endpoint that allows you to control how long client tokens last. Now you can configure the lifespan for each valid combination of Client, GrantType, and TokenType. See #3157 Co-authored-by: aeneasr <[email protected]> Co-authored-by: Andreas Bucksteeg <[email protected]>
This change introduces a new endpoint that allows you to control how long client tokens last. Now you can configure the lifespan for each valid combination of Client, GrantType, and TokenType. See #3157 Co-authored-by: aeneasr <[email protected]> Co-authored-by: Andreas Bucksteeg <[email protected]>
Resolved and released! |
This change introduces a new endpoint that allows you to control how long client tokens last. Now you can configure the lifespan for each valid combination of Client, GrantType, and TokenType. See #3157 Co-authored-by: aeneasr <[email protected]> Co-authored-by: Andreas Bucksteeg <[email protected]>
This change introduces a new endpoint that allows you to control how long client tokens last. Now you can configure the lifespan for each valid combination of Client, GrantType, and TokenType. See #3157 Co-authored-by: aeneasr <[email protected]> Co-authored-by: Andreas Bucksteeg <[email protected]>
This change introduces a new endpoint that allows you to control how long client tokens last. Now you can configure the lifespan for each valid combination of Client, GrantType, and TokenType. See #3157 Co-authored-by: aeneasr <[email protected]> Co-authored-by: Andreas Bucksteeg <[email protected]>
Preflight checklist
Describe your problem
It is not possible to set varying TTLs per OAuth2 Client, only globally. This is not practicable in regulated environments.
Describe your ideal solution
Be able to set the TTL of different OAuth2 Flows per OAuth2 Client. This functionality would not be available for OIDC Dynamic Registration but only when using the administrative OAuth2 Client management endpoints.
Optimally, the configuration would be part of the HTTP REST request for a new endpoint:
This is a "safer" method of controlling these highly privileged fields. For example, this endpoint could be only available to certain callers and dis/enabled in some type of firewall.
Additionally, it allows us to stray from the OIDC Dynamic Client Registration spec as it's an additional endpoint and we have more freedom in designing it and its responses.
Workarounds or alternatives
Optionally, the configuration would be part of the HTTP REST Request:
This option is not preferred and should be avoided
Part of clients endpoint
This could be part of the
/clients
endpoint, with the caveat that it doesn't follow oidc client registration conventions.Flat payload
The following payload would feel more OAuth2-y:
but it is also harder to define more granular controls like
client_credentials
grant has 1h andauthorize_code
grant has 1d lifespan.TTL per Consent
Set the TTL per consent. This would also be possible, but does not cover non-browser flows such as the OAuth2 Client Credentials flow or some other token exchange flows.
Version
v1.x
Additional Context
No response
The text was updated successfully, but these errors were encountered: