-
Notifications
You must be signed in to change notification settings - Fork 5
Add tokenExchange OAuth2 flow (OAuth 2.0 Token Exchange, RFC 8693) #44
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
Merged
+195
−5
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
b3e3123
Add tokenExchange OAuth2 flow (RFC 8693), mirroring OAI/OpenAPI-Speci…
cayetanobv 877ee12
Add subjectTokenScheme to the tokenExchange flow
cayetanobv 62049e5
Reference the token_exchange scheme from an asset in the example
cayetanobv 4ee45da
Move the token-exchange demo to a dedicated, focused example
cayetanobv 5720ec7
Require subjectTokenScheme for the tokenExchange flow
cayetanobv 91c620e
Trim the token-exchange example to foreground the two edges
cayetanobv 4de5f58
Chain via scheme-level auth:refs; add explicit subjectTokenType
cayetanobv ecbc111
Make scheme-level auth:refs one-of, matching Asset/Link semantics
cayetanobv 2d05232
Potential fix for pull request finding
m-mohr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| { | ||
| "type": "Collection", | ||
| "stac_version": "1.0.0", | ||
| "id": "collection-token-exchange", | ||
| "title": "Gated collection — two-step access via OAuth 2.0 Token Exchange", | ||
| "description": "Public STAC metadata, access-controlled assets. The asset points at the scheme that guards it (`auth:refs`); that scheme points the same way (scheme-level `auth:refs`) at the identity scheme(s) whose token it exchanges — any one of them. The `oidc` scheme guards no asset on its own: it is the exchange's input.", | ||
| "license": "proprietary", | ||
| "stac_extensions": [ | ||
| "https://stac-extensions.github.io/authentication/v1.1.0/schema.json" | ||
| ], | ||
| "auth:schemes": { | ||
| "oidc": { | ||
| "type": "openIdConnect", | ||
| "openIdConnectUrl": "https://auth.example.com/.well-known/openid-configuration" | ||
| }, | ||
| "token_exchange": { | ||
| "type": "oauth2", | ||
| "description": "RFC 8693 token exchange: present the `oidc` identity token as the `subject_token` at the `tokenUrl` and receive short-lived, scoped credentials covering every asset below.", | ||
| "auth:refs": [ | ||
| "oidc" | ||
| ], | ||
| "flows": { | ||
| "tokenExchange": { | ||
| "tokenUrl": "https://credentials.example.com/oauth/token", | ||
| "subjectTokenType": "urn:ietf:params:oauth:token-type:id_token", | ||
| "scopes": { | ||
| "read:data": "Read this collection's data assets" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "extent": { | ||
| "spatial": { | ||
| "bbox": [ | ||
| [ | ||
| -3.9, | ||
| 40.3, | ||
| -3.5, | ||
| 40.6 | ||
| ] | ||
| ] | ||
| }, | ||
| "temporal": { | ||
| "interval": [ | ||
| [ | ||
| "2025-01-01T00:00:00Z", | ||
| null | ||
| ] | ||
| ] | ||
| } | ||
| }, | ||
| "links": [ | ||
| { | ||
| "href": "https://example.com/examples/collection-token-exchange.json", | ||
| "rel": "self" | ||
| } | ||
| ], | ||
| "assets": { | ||
| "data": { | ||
| "href": "https://storage.example.com/private-bucket/data.parquet", | ||
| "type": "application/vnd.apache.parquet", | ||
| "roles": [ | ||
| "data" | ||
| ], | ||
| "auth:refs": [ | ||
| "token_exchange" | ||
| ] | ||
| }, | ||
| "metadata": { | ||
| "href": "https://storage.example.com/private-bucket/metadata.json", | ||
| "type": "application/json", | ||
| "roles": [ | ||
| "metadata" | ||
| ], | ||
| "auth:refs": [ | ||
| "token_exchange" | ||
| ] | ||
| } | ||
| } | ||
| } |
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.