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

Add support for RFC 8693 token exchange requests #581

Merged
merged 1 commit into from
Nov 14, 2024

Conversation

atheriel
Copy link
Collaborator

@atheriel atheriel commented Nov 13, 2024

This commit adds a new OAuth "flow" to perform the token exchange protocol described in RFC 8693. This is a pretty obscure and advanced OAuth feature, but I thought it would be nice to have some helpers to support it in httr2, anyway.

I'm not aware of that many implementations of this RFC, though there are a few to note:

Closes #460.

@atheriel atheriel force-pushed the rfc8693-token-exchange-flow branch from 214d728 to 1641c2a Compare November 13, 2024 19:57
R/oauth-flow-token-exchange.R Outdated Show resolved Hide resolved
actor_token = NULL,
actor_token_type = NULL,
token_params = list()) {
oauth_client_get_token(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This implementation was much simpler than I expected 😆

This commit adds a new OAuth "flow" to perform the token exchange
protocol described in RFC 8693 [0]. This is a pretty obscure and
advanced OAuth feature, but I thought it would be nice to have some
helpers to support it in `httr2`, anyway.

I'm not aware of *that* many implementations of this RFC, though there
are a few to note:

- GCP uses it for a couple of identity federation features [1].

- Okta uses it for some advanced delegation features [2].

- Some open-source auth tools like Curity seem to support it [3], as do
  various commercial identity management platforms like Asgardeo [4].

- Posit Connect uses it to power its OAuth integration feature [5].

Closes r-lib#460.

[0]: https://datatracker.ietf.org/doc/html/rfc8693
[1]: https://cloud.google.com/iam/docs/workforce-obtaining-short-lived-credentials
[2]: https://developer.okta.com/docs/guides/set-up-token-exchange/main/
[3]: https://curity.io/resources/learn/token-exchange-flow/
[4]: https://wso2.com/asgardeo/docs/guides/authentication/configure-token-exchange/
[5]: https://docs.posit.co/connect/admin/integrations/oauth-integrations/

Signed-off-by: Aaron Jacobs <[email protected]>
@atheriel atheriel force-pushed the rfc8693-token-exchange-flow branch from 1641c2a to 40b2aea Compare November 14, 2024 18:03
@atheriel
Copy link
Collaborator Author

I don't have write access to merge, you might have to do so on my behalf.

@hadley hadley merged commit 9271f32 into r-lib:main Nov 14, 2024
13 checks passed
@hadley
Copy link
Member

hadley commented Nov 14, 2024

I also gave you write access since you contribute quite a bit 😄

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

Successfully merging this pull request may close these issues.

Implement oauth_flow_exchange()
2 participants