oauth2-keycloak icon indicating copy to clipboard operation
oauth2-keycloak copied to clipboard

README.md Authorization Code Flow

Open mtgtnt opened this issue 2 years ago • 1 comments

$provider = new Stevenmaguire\OAuth2\Client\Provider\Keycloak([
    'authServerUrl'         => '{keycloak-server-url}',
    'realm'                 => '{keycloak-realm}',
    'clientId'              => '{keycloak-client-id}',
    'clientSecret'          => '{keycloak-client-secret}',
    'redirectUri'           => 'https://example.com/callback-url',
    'encryptionAlgorithm'   => 'RS256',                             // optional
    'encryptionKeyPath'     => '../key.pem'                         // optional
    'encryptionKey'         => 'contents_of_key_or_certificate'     // optional
    'version'               => '20.0.1',                            // optional
]);

'version' => '20.0.1', ~~// optional~~

since 18.0.0 this is required. I just spent 3 days tracking down a 'Invalid response received from Authorization Server. Expected JSON.' error when I finally found that scope:openid was not being added due to requiring this version. Since 20.0.0 it is even more important.

mtgtnt avatar Feb 02 '23 09:02 mtgtnt

After upgrade to 20.0.2 I got this error despite setting this version (and having openid in the scope auth url)

repli2dev avatar Feb 11 '23 12:02 repli2dev