Skip to content

Commit 889c025

Browse files
authored
fix: default openid scope for keycloak (#684)
1 parent 9f03a74 commit 889c025

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

Provider.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ class Provider extends AbstractProvider
1515

1616
protected $scopeSeparator = ' ';
1717

18+
protected $scopes = ['openid'];
19+
1820
public static function additionalConfigKeys()
1921
{
2022
return ['base_url', 'realms'];

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,13 @@ You should now be able to use the provider like you would regularly use Socialit
4242
```php
4343
return Socialite::driver('keycloak')->redirect();
4444
```
45+
46+
#### Keycloak <= 3.2
47+
48+
Keycloak below v3.2 requires no scopes to be set. Later versions require the `openid` scope for all requests.
49+
50+
```php
51+
return Socialite::driver('keycloak')->scopes([])->redirect();
52+
```
53+
54+
See [the upgrade guide](https://www.keycloak.org/docs/12.0/upgrading/#migrating-to-3-2-0).

0 commit comments

Comments
 (0)