mariovalney/laravel-keycloak-web-guard

Adding optional scopes

Closed this issue · 0 comments

We have optional scopes in keycloak but there is no way to add these to the keycloak-web.php. Currently KeycloakService only uses openid.

I would like to add a new configuration option for these optional scopes and add them to the login url.

Something like this:
keycloak-web.php

'optional_scopes' => ['scope1', 'scope2', 'scope4']

KeycloakService.php __construct

$this->scopes = ['openid'];
$this->scopes = array_merge($this->scopes, Config::get('keycloak-web.optional_scopes'));

KeycloakService.php getLoginUrl

$params = [
      'scope' => implode(' ', $this->scopes),
       ...
];