Open IkhlasAlaydi opened 3 years ago
Hi @IkhlasAlaydi
You must check if clientId is provided using setClientID('ClientIDHere')
or in constructor OpenIDConnectClient('https://...', 'ClientIDHere')
. Each token has an aud
claims in header, and must to match with your clientId
.
use Jumbojett\OpenIDConnectClient;
$oidc = new OpenIDConnectClient('https://id.provider.com',
'ClientIDHere',
'ClientSecretHere');
Other possibles causes can be an expired token
I had the issue with JWT claims verifying. In function verifyJWTclaims: $expected_at_hash = $this->urlEncode(substr(hash('sha'.$bit, $accessToken, true), 0, $len));
and in this $this->urlEncode:
protected function urlEncode($str) {
$enc = base64_encode($str);
$enc = rtrim($enc, '=');
// $enc = strtr($enc, '+/', '-_');
return $enc;
}
In this chars + and / are translated to - and _ for some reason. At least in my case commenting this out fixed the problem. My provider sends those chars on their hash and it is wrong to change them here.
hello everyone,
I faced the same issue now , I tried the suggested solutions and didn't work, I tried the same on different application on a different server and it worked properly , I compared the claims and token format they are the same , any ideas ?
I am working with codeigniter i have just added the below lines to the controller
when I login with wrong credentials it give me the option to re-enter the credentials again , but when I Login with the right ones the error is shown