Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 8 |
|
0.00% |
0 / 6 |
CRAP | |
0.00% |
0 / 1 |
LemonLdap | |
0.00% |
0 / 8 |
|
0.00% |
0 / 6 |
42 | |
0.00% |
0 / 1 |
getBaseAuthorizationUrl | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getBaseAccessTokenUrl | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getResourceOwnerDetailsUrl | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getLogoutUrl | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 | |||
getBaseLogoutUrl | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
createResourceOwner | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | |
3 | namespace App\Oauth2Provider\LemonLdap; |
4 | |
5 | use App\Oauth2Provider\Keycloak\Keycloak; |
6 | use League\OAuth2\Client\Token\AccessToken; |
7 | |
8 | class LemonLdap extends Keycloak |
9 | { |
10 | /** |
11 | * Get authorization url to begin OAuth flow. |
12 | */ |
13 | public function getBaseAuthorizationUrl(): string |
14 | { |
15 | return $this->authServerUrl . '/authorize'; |
16 | } |
17 | |
18 | /** |
19 | * Get access token url to retrieve token. |
20 | */ |
21 | public function getBaseAccessTokenUrl(array $params): string |
22 | { |
23 | return $this->authServerUrl . '/token'; |
24 | } |
25 | |
26 | /** |
27 | * Get provider url to fetch user details. |
28 | */ |
29 | public function getResourceOwnerDetailsUrl(AccessToken $token): string |
30 | { |
31 | return $this->authServerUrl . '/userinfo'; |
32 | } |
33 | |
34 | /** |
35 | * Builds the logout URL. |
36 | * |
37 | * @return string Authorization URL |
38 | */ |
39 | public function getLogoutUrl(array $options = []): string |
40 | { |
41 | $base = $this->getBaseLogoutUrl(); |
42 | $query = $this->buildQueryString($options); |
43 | |
44 | return $this->appendQuery($base, $query); |
45 | } |
46 | |
47 | /** |
48 | * Get logout url to logout of session token. |
49 | */ |
50 | private function getBaseLogoutUrl(): string |
51 | { |
52 | return $this->authServerUrl . '/logout'; |
53 | } |
54 | |
55 | /** |
56 | * Generate a user object from a successful user details request. |
57 | */ |
58 | protected function createResourceOwner(array $response, AccessToken $token): LemonLdapResourceOwner |
59 | { |
60 | return new LemonLdapResourceOwner($response); |
61 | } |
62 | } |