@@ -7,7 +7,7 @@ |
||
7 | 7 | use Parroauth2\Client\ClientConfig; |
8 | 8 | use Parroauth2\Client\Provider\ProviderLoader; |
9 | 9 | |
10 | -require_once __DIR__.'/../vendor/autoload.php'; |
|
10 | +require_once __DIR__ . '/../vendor/autoload.php'; |
|
11 | 11 | |
12 | 12 | // Load the provider. Provide a storage is not required here : token is not stored |
13 | 13 | $loader = new ProviderLoader(); |
@@ -13,12 +13,12 @@ discard block |
||
13 | 13 | use Parroauth2\Client\Provider\ProviderLoader; |
14 | 14 | use Parroauth2\Client\Storage\ArrayStorage; |
15 | 15 | |
16 | -require_once __DIR__.'/../vendor/autoload.php'; |
|
16 | +require_once __DIR__ . '/../vendor/autoload.php'; |
|
17 | 17 | |
18 | 18 | // Start the session system and storage |
19 | 19 | session_start(); |
20 | 20 | $session = new ArrayStorage($_SESSION['oauth'] ?? []); |
21 | -register_shutdown_function(function () use($session) { $_SESSION['oauth'] = $session->all(); }); |
|
21 | +register_shutdown_function(function() use($session) { $_SESSION['oauth'] = $session->all(); }); |
|
22 | 22 | |
23 | 23 | // Load the provider |
24 | 24 | $loader = new ProviderLoader(new BaseClientFactory($session)); |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | } |
52 | 52 | |
53 | 53 | // Generate the authorization endpoint URL for start the authentication |
54 | - echo '<a href="'.$flow->authorizationUri('http://192.168.0.139/~vquatrevieux/test_parroauth/standard.php/connect').'">Me connecter</a>'; |
|
54 | + echo '<a href="' . $flow->authorizationUri('http://192.168.0.139/~vquatrevieux/test_parroauth/standard.php/connect') . '">Me connecter</a>'; |
|
55 | 55 | return; |
56 | 56 | } |
57 | 57 | |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | $client->endPoints()->revocation()->call(); // Note: the token is provided by the TokenStorage extension |
63 | 63 | |
64 | 64 | // Logout from the OP |
65 | - header('Location: '.$client->endPoints()->endSession()->redirectUri('http://192.168.0.139/~vquatrevieux/test_parroauth/standard.php')->uri()); |
|
65 | + header('Location: ' . $client->endPoints()->endSession()->redirectUri('http://192.168.0.139/~vquatrevieux/test_parroauth/standard.php')->uri()); |
|
66 | 66 | return; |
67 | 67 | } |
68 | 68 |
@@ -11,7 +11,7 @@ |
||
11 | 11 | use Parroauth2\Client\Provider\ProviderLoader; |
12 | 12 | use Psr\SimpleCache\CacheInterface; |
13 | 13 | |
14 | -require_once __DIR__.'/../vendor/autoload.php'; |
|
14 | +require_once __DIR__ . '/../vendor/autoload.php'; |
|
15 | 15 | |
16 | 16 | class Authenticator |
17 | 17 | { |
@@ -65,7 +65,7 @@ |
||
65 | 65 | |
66 | 66 | $this->openidConfigurator = new EndPointConfigurator([ |
67 | 67 | OpenIdAuthorizationEndPoint::NAME => OpenIdAuthorizationEndPoint::class, |
68 | - OpenIdTokenEndPoint::NAME => function (ClientInterface $client) { |
|
68 | + OpenIdTokenEndPoint::NAME => function(ClientInterface $client) { |
|
69 | 69 | return new OpenIdTokenEndPoint($client, $this->idTokenParser ?: new JwsIdTokenParser()); |
70 | 70 | }, |
71 | 71 | UserinfoEndPoint::NAME => UserinfoEndPoint::class, |
@@ -104,7 +104,7 @@ |
||
104 | 104 | */ |
105 | 105 | public function client(ClientConfig $config): ClientInterface |
106 | 106 | { |
107 | - return new ProxyClient($config, function (ClientConfig $config) { |
|
107 | + return new ProxyClient($config, function(ClientConfig $config) { |
|
108 | 108 | return $this->provider()->client($config); |
109 | 109 | }); |
110 | 110 | } |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | */ |
32 | 32 | public function onToken(TokenEndPoint $endPoint): TokenEndPoint |
33 | 33 | { |
34 | - return $endPoint->onResponse(function (TokenResponse $response) { |
|
34 | + return $endPoint->onResponse(function(TokenResponse $response) { |
|
35 | 35 | $this->client()->storage()->store(self::class, $response); |
36 | 36 | }); |
37 | 37 | } |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | return $this->expired() |
53 | 53 | ? $endPoint |
54 | 54 | : $endPoint->accessToken($this->token()->accessToken()) |
55 | - ->onResponse(function (IntrospectionResponse $response) { |
|
55 | + ->onResponse(function(IntrospectionResponse $response) { |
|
56 | 56 | if (!$response->active()) { |
57 | 57 | $this->clear(); |
58 | 58 | } |
@@ -53,7 +53,7 @@ |
||
53 | 53 | public function __construct(ClientInterface $client, callable $responseFactory = null) |
54 | 54 | { |
55 | 55 | $this->client = $client; |
56 | - $this->responseFactory = $responseFactory ?: function (array $response): TokenResponse { |
|
56 | + $this->responseFactory = $responseFactory ?: function(array $response): TokenResponse { |
|
57 | 57 | return new TokenResponse($response); |
58 | 58 | }; |
59 | 59 | } |