Skip to content

OIDC discovery fails for issuers with a trailing slash #507

Description

@karedum

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions