Skip to content

feat(http_config): support JWT token auth as alternative to client secret (RFC 7523 3.1) #781

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jkroepke
Copy link
Member

This PR implements JWT Authentication for Authorization Grant (RFC 7523 3.1) as alternative to static client credentials.

As I know, this auth flow is used by STACKIT Service Accounts (Key Flow).

I tried to not break any exists method signatures to remain backwards compatibility.


Note: This PR does not provide support for JWTs in Client Authentication Processing, since it not supported by x/oauth2 yet. See golang/oauth2#745

As I know, JWTs in Client Authentication Processing is used by Microsoft Entra ID (Client Certificates).

@jkroepke jkroepke requested a review from Copilot April 16, 2025 21:17
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.


default:
authorization := r.Header.Get("Authorization")
if authorization != "Bearer "+ExpectedAccessToken {
Copy link
Preview

Copilot AI Apr 16, 2025

Choose a reason for hiding this comment

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

Consider adding a WriteHeader call with an appropriate HTTP status code in the default case when the 'Authorization' header does not match. This ensures that error responses are consistent and unambiguous.

Suggested change
if authorization != "Bearer "+ExpectedAccessToken {
if authorization != "Bearer "+ExpectedAccessToken {
w.WriteHeader(http.StatusUnauthorized)

Copilot is powered by AI, so mistakes are possible. Review output carefully before use.

@jkroepke jkroepke marked this pull request as ready for review April 17, 2025 09:00
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