robsontenorio / laravel-keycloak-guard

🔑 Simple Keycloak Guard for Laravel
MIT License
434 stars 141 forks source link

[Keycloak Guard] Algorithm not allowed #47

Closed Shawlee76 closed 3 years ago

Shawlee76 commented 3 years ago

Hi, when I try to retrieve some resources from my api laravel application , I have the following error :

"message": "[Keycloak Guard] Algorithm not allowed", "exception": "KeycloakGuard\Exceptions\TokenException", "file": "C:\***\keycloak-laravel\vendor\robsontenorio\laravel-keycloak-guard\src\KeycloakGuard.php", "line": 41,

Do you have any idea about this ? Thanks for you answer.

Charlie

Ettychel commented 3 years ago

@Shawlee76 Please translate in Google and you will understand everything. Пакет был изменён и теперь в файле robsontenorio/laravel-keycloak-guard/src/Token.php:18 вот это: return $token ? JWT::decode($token, $publicKey, ['RS256']) : null; Т.е. теперь алгоритм не извлекается из конфигурации, а прописан намертво. Нужно переписать в адекватное значение как было раньше: return $token ? JWT::decode($token, $publicKey, explode(',', config('keycloak')['algoritm'])) : null; Это очень ужастный поступок со стороны разработчика...

robsontenorio commented 3 years ago

It has to do with token algorithm on Keycloak server settings, not this package itself.

Shawlee76 commented 3 years ago

Hi, My Keycloak server settings have not changed; It is the default settings. image

Shawlee76 commented 3 years ago

Problème solved. I was using the refresh token, not the access token. thanks.