OpenID-Connect-PHP icon indicating copy to clipboard operation
OpenID-Connect-PHP copied to clipboard

Allow setting different discovery URL

Open singpolyma opened this issue 2 years ago • 4 comments
trafficstars

When using https://www.rfc-editor.org/rfc/rfc7628.html a full URL to an OIDC discovery document is returned, not just an issuer to which a well-known can be appended. So it would be useful to have a way to put this full URL in to be used for discovery, overriding the default .well-known URL.

singpolyma avatar May 16 '23 00:05 singpolyma

So you want to set a different openid-configuration endpoint? https://github.com/jumbojett/OpenID-Connect-PHP/blob/8ec206b60f87b4a1886c9c3eefa5f5d81d1ccc35/src/OpenIDConnectClient.php#L621

ricklambrechts avatar May 16 '23 10:05 ricklambrechts

Yes, exactly, something that would override this whole line and become the URL for $well_known_config_url

singpolyma avatar May 16 '23 13:05 singpolyma

So if you could extend the class and overwrite a new to build function like below that would be a solution? I can create a PR for this if you want.

class CustomOpenIDConnectClient extends OpenIDConnectClient
{
    protected function getWellKnownConfigUrl()
    {
        return "https://custom-url.example/custom-endpoint";
    }
}

ricklambrechts avatar May 16 '23 15:05 ricklambrechts

Yes, that would be a fine solution for my case

singpolyma avatar May 16 '23 17:05 singpolyma