Skip to content

Commit 74ccd42

Browse files
committed
Add JWKS response to the main Server class.
1 parent deb9ca7 commit 74ccd42

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

src/Server.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use League\OAuth2\Server\Exception\OAuthServerException;
88
use Pdsinterop\Solid\Auth\Entity\User;
99
use Pdsinterop\Solid\Auth\Enum\OpenId\OpenIdConnectMetadata as OidcMeta;
10+
use Pdsinterop\Solid\Auth\Utils\Jwks;
1011
use Psr\Http\Message\ResponseInterface as Response;
1112
use Psr\Http\Message\ServerRequestInterface as Request;
1213

@@ -54,6 +55,16 @@ final public function respondToWellKnownRequest() : Response
5455
return $this->createJsonResponse($response, $serverConfig);
5556
}
5657

58+
final public function respondToJwksRequest(/*Jwks $jwks*/) : Response
59+
{
60+
$response = $this->response;
61+
$key = $this->config->getKeys()->getPublicKey();
62+
63+
$jwks = new Jwks($key);
64+
65+
return $this->createJsonResponse($response, $jwks);
66+
}
67+
5768
final public function respondToAuthorizationRequest(
5869
Request $request,
5970
User $user = null,

0 commit comments

Comments
 (0)