jumbojett / OpenID-Connect-PHP

Minimalist OpenID Connect client

Home Page:https://github.com/jumbojett/OpenID-Connect-PHP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow setting different discovery URL

singpolyma opened this issue · comments

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.

So you want to set a different openid-configuration endpoint?

$well_known_config_url = rtrim($this->getProviderURL(), '/') . '/.well-known/openid-configuration';

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

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";
    }
}

Yes, that would be a fine solution for my case