providers/proxy: fix handling of AUTHENTIK_HOST_BROWSER (#11722)

* providers/proxy: fix handling of AUTHENTIK_HOST_BROWSER (#9622/#4688/#6476)

* chore: fix tests
This commit is contained in:
Simon Erhardt
2024-10-24 16:34:45 +02:00
committed by GitHub
parent 238a396309
commit f482937474
2 changed files with 4 additions and 1 deletions

View File

@ -82,6 +82,9 @@ func GetOIDCEndpoint(p api.ProxyOutpostConfig, authentikHost string, embedded bo
if embedded { if embedded {
ep.Issuer = updateURL(ep.Issuer, newHost.Scheme, newHost.Host) ep.Issuer = updateURL(ep.Issuer, newHost.Scheme, newHost.Host)
ep.JwksUri = updateURL(jwksUri, newHost.Scheme, newHost.Host) ep.JwksUri = updateURL(jwksUri, newHost.Scheme, newHost.Host)
} else {
// Fixes: https://github.com/goauthentik/authentik/issues/9622 / ep.Issuer must be the HostBrowser URL
ep.Issuer = updateURL(ep.Issuer, newBrowserHost.Scheme, newBrowserHost.Host)
} }
return ep return ep
} }

View File

@ -55,7 +55,7 @@ func TestEndpointAuthentikHostBrowser(t *testing.T) {
assert.Equal(t, "https://browser.test.goauthentik.io/application/o/authorize/", ep.AuthURL) assert.Equal(t, "https://browser.test.goauthentik.io/application/o/authorize/", ep.AuthURL)
assert.Equal(t, "https://browser.test.goauthentik.io/application/o/test-app/end-session/", ep.EndSessionEndpoint) assert.Equal(t, "https://browser.test.goauthentik.io/application/o/test-app/end-session/", ep.EndSessionEndpoint)
assert.Equal(t, "https://test.goauthentik.io/application/o/token/", ep.TokenURL) assert.Equal(t, "https://test.goauthentik.io/application/o/token/", ep.TokenURL)
assert.Equal(t, "https://test.goauthentik.io/application/o/test-app/", ep.Issuer) assert.Equal(t, "https://browser.test.goauthentik.io/application/o/test-app/", ep.Issuer)
assert.Equal(t, "https://test.goauthentik.io/application/o/test-app/jwks/", ep.JwksUri) assert.Equal(t, "https://test.goauthentik.io/application/o/test-app/jwks/", ep.JwksUri)
assert.Equal(t, "https://test.goauthentik.io/application/o/introspect/", ep.TokenIntrospection) assert.Equal(t, "https://test.goauthentik.io/application/o/introspect/", ep.TokenIntrospection)
} }