Skip to content

Commit e4d3701

Browse files
hwcopelandclaude
andcommitted
fix(auth): use discovery doc issuer instead of normalized URL
The auth middleware stripped trailing slashes from the issuer URL, but Authentik's JWT includes the trailing slash. Use the issuer from the OIDC discovery document directly since that matches what Authentik puts in the iss claim. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent f692aa5 commit e4d3701

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

  • rke2/chem/compute-infrastructure/k8s-jobs/controller

rke2/chem/compute-infrastructure/k8s-jobs/controller/auth.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,12 @@ func NewAuthMiddleware(issuerURL string) (*AuthMiddleware, error) {
101101
"::1/128", // IPv6 loopback
102102
})
103103

104+
// Use the issuer from the discovery document (not our input) since
105+
// that's exactly what Authentik puts in the JWT's iss claim.
106+
if disc.Issuer != "" {
107+
issuerURL = disc.Issuer
108+
}
109+
104110
am := &AuthMiddleware{
105111
jwks: jwks,
106112
issuerURL: issuerURL,

0 commit comments

Comments
 (0)