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 tokens in upstream headers #37

Merged
merged 2 commits into from
Jan 4, 2025

Conversation

sevensolutions
Copy link
Owner

@sevensolutions sevensolutions commented Jan 4, 2025

This PR adds support for sending the access tokens to the upstream service by using custom headers as described in #36.

Please note that this will be a breaking change in the Header-configuration.
Previously, sending claim-values to the upstream was done like this:

Headers:
  MapClaims:
    - Claim: "preferred_username"
      Header: "X-Oidc-Username"
    - Claim: "sub"
      Header: "X-Oidc-Subject"

Which now needs to be written as:

Headers:
  - Name: "X-Oidc-Username"
    Value: "{{`{{ .claims.preferred_username }}`}}"
  - Name: "X-Oidc-Subject"
    Value: "{{`{{ .claims.sub }}`}}"

But in addition, this now also support sending tokens:

Headers:
  - Name: "Authorization"
    Value: "{{`Bearer {{ .accessToken }}`}}"

@sevensolutions sevensolutions merged commit cb9d8d2 into main Jan 4, 2025
2 checks passed
@sevensolutions sevensolutions deleted the feature/header-templates branch January 4, 2025 11:02
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.

1 participant