Support tenant propagation and refresh tokens in client credentials - #54
Merged
Merged
Conversation
- A verification endpoint's 2xx response can now include a tenant JSON property; AuthProxy embeds it as a cratis/tenant claim on the issued token so the existing Claim tenant-resolution strategy can resolve it and set the Tenant-ID header on proxied requests, exactly as it does for every other tenant source. - Every client_credentials grant now also mints a refresh token, issued under its own Data Protection purpose so it can never be used as an access token (or vice versa). /.cratis/token accepts grant_type=refresh_token to exchange a refresh token for a new access/refresh token pair without resending the client secret.
Covers tenant round-tripping through both access and refresh tokens, the Claim-based tenant exposure on the authenticated principal, the refresh_token grant's success and failure paths, and rejection when an access token and refresh token are used in place of one another.
Explains the optional tenant property on the verification response, how it maps onto the existing Claim tenant-resolution strategy, and the new refresh_token grant flow with its lack of a revocation list.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extends the back-channel client-credentials flow: a verified request can now carry a tenant through to the proxied service, and clients can refresh an access token without resending their client secret.
Added
2xxresponse may now include atenantJSON property. AuthProxy embeds it in the issued token as acratis/tenantclaim, which the existingClaimtenant-resolution strategy can resolve into theTenant-IDheader on proxied requests.POST /.cratis/tokennow also acceptsgrant_type=refresh_token, exchanging a refresh token for a new access/refresh token pair without recontacting the verification endpoint. Every successfulclient_credentialsgrant now returns arefresh_tokenalongside the access token.Changed
authentication.md,services.md, andtenancy.md.