Skip to content

Various fixes#5742

Merged
carmenlau merged 3 commits into
authgear:mainfrom
tung2744:dev-3616
May 28, 2026
Merged

Various fixes#5742
carmenlau merged 3 commits into
authgear:mainfrom
tung2744:dev-3616

Conversation

@tung2744
Copy link
Copy Markdown
Contributor

ref DEV-3616

  • Fix portal missing clock skew on verifying admin api jwt
  • Fix portal cannot access admin api with internal endpoint

tung2744 and others added 2 commits May 28, 2026 15:08
…t is HTTPS

When EndpointInternal is set to an HTTP URL but the public Endpoint uses HTTPS,
PublicOriginMiddleware on the auth server issues a 307 redirect because the
request scheme does not match the configured public_origin scheme. The portal
HTTP client does not follow redirects, causing the JWKS fetch to fail.

Fix by setting X-Forwarded-Proto to the public endpoint's scheme on the internal
request, so PublicOriginMiddleware sees the correct scheme and passes the request
through without redirecting.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
// that the request is already on the correct scheme, suppressing the redirect.
// This mirrors what a TLS-terminating load balancer does when forwarding to an
// internal HTTP backend.
req.Header.Set("X-Forwarded-Proto", parsedEndpoint.Scheme)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we need X-Forwarded-Host for this case?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It is handled in L170 already.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Got it, thanks!

@carmenlau carmenlau merged commit d799ec3 into authgear:main May 28, 2026
11 checks passed
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.

2 participants