@@ -10,30 +10,29 @@ class TokenController extends ServerController
1010{
1111 final public function __invoke (ServerRequestInterface $ request , array $ args ): ResponseInterface
1212 {
13- $ code = $ _POST ['code ' ];
14- $ clientId = $ _POST ['client_id ' ];
13+ $ code = $ request ->$ request ->getParsedBody ()['code ' ];
14+ $ clientId = $ request ->getParsedBody ()['client_id ' ];
15+
16+ /*
1517 $DPoP = $_SERVER['HTTP_DPOP'];
16-
1718 $parser = new \Lcobucci\JWT\Parser();
1819 try {
1920 $token = $parser->parse($DPoP);
2021// var_dump($token);
2122 } catch(\Exception $e) {
2223 return $this->getResponse()->withStatus(409, "Invalid token");
2324 }
24-
25+ */
2526 $ registration = $ this ->config ->getClientRegistration ($ clientId );
2627 $ approval = $ this ->checkApproval ($ clientId );
2728
2829 if ($ approval ) {
2930 $ response = new \Laminas \Diactoros \Response ();
3031 $ server = new \Pdsinterop \Solid \Auth \Server ($ this ->authServerFactory , $ this ->authServerConfig , $ response );
3132 $ response = $ server ->respondToAccessTokenRequest ($ request );
33+ $ response = $ this ->tokenGenerator ->addIdTokenToResponse ($ response , $ clientId , $ this ->getProfilePage (), $ _SESSION ['nonce ' ], $ this ->config ->getPrivateKey ());
3234
33- // $response = $this->tokenGenerator->addIdTokenToResponse($response, $clientId, $this->getProfilePage(), $_SESSION['nonce'], $this->config->getPrivateKey());
3435 return $ response ;
35- // $idToken = $this->tokenGenerator->generateIdToken($code, $clientId, $this->getProfilePage(), $_SESSION['nonce'], $this->config->getPrivateKey());
36- // return new JsonResponse(array("token_type" => "DPoP", "id_token" => $idToken));
3736 }
3837 return new JsonResponse (array ());
3938 }
0 commit comments