OIDC discovery fails for issuers with a trailing slash
OidcDiscovery::fetchMetadata() strips the trailing slash from the issuer before discovery:
$issuer = rtrim($issuer, '/');
The normalized issuer is then used to validate the issuer returned in the discovery metadata.
This causes discovery to fail for providers that use a trailing slash in their canonical issuer, such as Authentik:
Expected: https://auth.example.com/application/o/mcp
Got: https://auth.example.com/application/o/mcp/
The trailing slash should only be removed when building the discovery URL. The original issuer should be preserved for validation.
Related PR
OIDC discovery fails for issuers with a trailing slash
OidcDiscovery::fetchMetadata()strips the trailing slash from the issuer before discovery:The normalized issuer is then used to validate the
issuerreturned in the discovery metadata.This causes discovery to fail for providers that use a trailing slash in their canonical issuer, such as Authentik:
The trailing slash should only be removed when building the discovery URL. The original issuer should be preserved for validation.
Related PR