Skip to content

Commit e730a9c

Browse files
committed
Add JWKs request and response to code example.
1 parent 8e24d96 commit e730a9c

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

tests/example.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,14 @@
3434
$keyPath = dirname(__DIR__) . '/tests/fixtures/keys';
3535
$encryptionKey = file_get_contents($keyPath . '/encryption.key');
3636
$privateKey = file_get_contents($keyPath . '/private.key');
37+
$publicKey = file_get_contents($keyPath . '/public.key');
3738

3839
$config = (new \Pdsinterop\Solid\Auth\Factory\ConfigFactory(
3940
$clientIdentifier,
4041
$clientSecret,
4142
$encryptionKey,
4243
$privateKey,
44+
$publicKey,
4345
[
4446
/* URL of the OP's OAuth 2.0 Authorization Endpoint [OpenID.Core]. */
4547
\Pdsinterop\Solid\Auth\Enum\OpenId\OpenIdConnectMetadata::AUTHORIZATION_ENDPOINT => 'https://server/authorize',
@@ -67,7 +69,7 @@
6769
* of keys provided. When used, the bare key values MUST still be
6870
* present and MUST match those in the certificate.
6971
*/
70-
\Pdsinterop\Solid\Auth\Enum\OpenId\OpenIdConnectMetadata::JWKS_URI => 'https://server/jwk'
72+
\Pdsinterop\Solid\Auth\Enum\OpenId\OpenIdConnectMetadata::JWKS_URI => 'https://server/.well-known/jwks.json'
7173
]
7274
))->create();
7375

@@ -177,6 +179,10 @@
177179
$response = $server->respondToAuthorizationRequest($request, $user, $approval, $callback);
178180
break;
179181

182+
case 'GET/.well-known/jwks.json':
183+
$response = $server->respondToJwksRequest();
184+
break;
185+
180186
default:
181187
$response->getBody()->write('404');
182188
$response = $response->withStatus(404);

0 commit comments

Comments
 (0)