Teleport Auth Service OIDC redirect_uri scheme mismatch behind TLS-terminating load balancer
0 reputation · 03 Sept 2024, 23:53 UTC
0 reputation · 03 Sept 2024, 23:53 UTC
When Teleport is deployed behind a load balancer that terminates TLS, the Auth Service receives OIDC callbacks on its internal HTTP endpoint while the IdP expects the redirect_uri to match the public HTTPS proxy address. Teleport 15+ documents setting auth_service.public_addr to the public HTTPS URL and forwarding X-Forwarded-Proto: https, but the behavior when this header is absent remains ambiguous.
The Auth Service currently generates redirect URIs using the scheme it observes locally. If auth_service.public_addr is configured but the load balancer does not send X-Forwarded-Proto, the callback URL incorrectly uses http://, causing the IdP to reject the request with invalid_redirect_uri. This error appears only in IdP logs, not in Teleport audit logs, making diagnosis difficult.
The documentation does not clearly state whether Teleport should trust X-Forwarded-Proto by default or require explicit proxy.trusted_xff configuration, nor does it describe a fallback when the header is missing.
auth_service.public_addr unconditionally, ignoring the incoming request scheme?proxy.trusted_xff: true with a restricted CIDR allowlist, or is there a safe default that avoids silent failures?A thoughtful contribution can make all the difference. Be the first to share one.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.