|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* PHP version 7 |
|
4
|
|
|
* Application: directus_keycloak_client |
|
5
|
|
|
* |
|
6
|
|
|
* @category OAuth_2_Client_Library_Usage_For_Keycloak_With_Directus |
|
7
|
|
|
* @package Makuro\Directus\KeycloakClient\Provider |
|
8
|
|
|
* @author Eric Delaporte <[email protected]> |
|
9
|
|
|
* @license https://opensource.org/licenses/MIT MIT |
|
10
|
|
|
* @link https://packagist.org/packages/makuro/directus_keycloak_client |
|
11
|
|
|
* Date: 19.11.19 |
|
12
|
|
|
* Time: 23:59 |
|
13
|
|
|
*/ |
|
14
|
|
|
namespace Makuro\Directus\KeycloakClient; |
|
15
|
|
|
|
|
16
|
|
|
use Directus\Authentication\Sso\TwoSocialProvider; |
|
|
|
|
|
|
17
|
|
|
use League\OAuth2\Client\Provider\AbstractProvider; |
|
18
|
|
|
use Makuro\Directus\KeycloakClient\Provider\Keycloak; |
|
19
|
|
|
|
|
20
|
|
|
/** |
|
21
|
|
|
* Class Provider |
|
22
|
|
|
* |
|
23
|
|
|
* @category OAuth_2_Client_Library_Usage_For_Keycloak_With_Directus |
|
24
|
|
|
* @package Makuro\Directus\KeycloakClient\Provider |
|
25
|
|
|
* @author Eric Delaporte <[email protected]> |
|
26
|
|
|
* @license https://opensource.org/licenses/MIT MIT |
|
27
|
|
|
* @link https://packagist.org/packages/makuro/directus_keycloak_client |
|
28
|
|
|
*/ |
|
29
|
|
|
class Provider extends TwoSocialProvider |
|
30
|
|
|
{ |
|
31
|
|
|
/** |
|
32
|
|
|
* Holds the actual provider class |
|
33
|
|
|
* |
|
34
|
|
|
* @var Keycloak |
|
35
|
|
|
*/ |
|
36
|
|
|
protected $provider = null; |
|
37
|
|
|
|
|
38
|
|
|
/** |
|
39
|
|
|
* Returns scopes |
|
40
|
|
|
* |
|
41
|
|
|
* @inheritDoc |
|
42
|
|
|
* @return array |
|
43
|
|
|
*/ |
|
44
|
|
|
public function getScopes() |
|
45
|
|
|
{ |
|
46
|
|
|
return [ |
|
47
|
|
|
'email' |
|
48
|
|
|
]; |
|
49
|
|
|
} |
|
50
|
|
|
|
|
51
|
|
|
/** |
|
52
|
|
|
* Creates the Google provider oAuth client |
|
53
|
|
|
* |
|
54
|
|
|
* @return AbstractProvider |
|
55
|
|
|
*/ |
|
56
|
|
|
protected function createProvider() |
|
57
|
|
|
{ |
|
58
|
|
|
$this->provider = new Keycloak( |
|
59
|
|
|
[ |
|
60
|
|
|
'authServerUrl' => $this->config->get('authServerUrl'), |
|
61
|
|
|
'realm' => $this->config->get('realm'), |
|
62
|
|
|
'clientId' => $this->config->get('clientId'), |
|
63
|
|
|
'clientSecret' => $this->config->get('clientSecret'), |
|
64
|
|
|
'redirectUri' => $this->getRedirectUrl() |
|
65
|
|
|
] |
|
66
|
|
|
); |
|
67
|
|
|
|
|
68
|
|
|
return $this->provider; |
|
69
|
|
|
} |
|
70
|
|
|
|
|
71
|
|
|
|
|
72
|
|
|
} |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths