From 709c994700408e3a2a3dfd6dd0578afb0c49617b Mon Sep 17 00:00:00 2001 From: Mishkat Najam Date: Wed, 11 Oct 2023 14:13:00 +0100 Subject: [PATCH] remove superfluous comments and move redirect_uri from the client meta data to params --- .../OneLoginAuthorisationRequestHandler.php | 4 ---- .../OneLoginAuthorisationRequestService.php | 14 +++++++------- .../OneLoginAuthorisationRequestServiceTest.php | 1 + 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/service-api/app/src/App/src/Handler/OneLoginAuthorisationRequestHandler.php b/service-api/app/src/App/src/Handler/OneLoginAuthorisationRequestHandler.php index a8a649cb93..f87d3c19c7 100644 --- a/service-api/app/src/App/src/Handler/OneLoginAuthorisationRequestHandler.php +++ b/service-api/app/src/App/src/Handler/OneLoginAuthorisationRequestHandler.php @@ -23,10 +23,6 @@ public function __construct( } /** - * Handles a request and produces a response. - * - * May call other collaborating code to generate the response. - * * @param ServerRequestInterface $request * @return ResponseInterface * @throws Exception diff --git a/service-api/app/src/App/src/Service/Authentication/OneLoginAuthorisationRequestService.php b/service-api/app/src/App/src/Service/Authentication/OneLoginAuthorisationRequestService.php index 1eeb5d8d16..a470462491 100644 --- a/service-api/app/src/App/src/Service/Authentication/OneLoginAuthorisationRequestService.php +++ b/service-api/app/src/App/src/Service/Authentication/OneLoginAuthorisationRequestService.php @@ -31,7 +31,6 @@ public function createAuthorisationRequest(string $uiLocale): string 'client_id' => 'client-id', 'client_secret' => 'my-client-secret', 'token_endpoint_auth_method' => 'private_key_jwt', - 'redirect_uri' => '/lpa/dashboard', 'jwks' => [ 'keys' => [ ($this->JWKFactory)(), @@ -49,12 +48,13 @@ public function createAuthorisationRequest(string $uiLocale): string return $authorisationService->getAuthorizationUri( $client, [ - 'scope' => 'openid email', - 'state' => base64url_encode(random_bytes(12)), - 'nonce' => openssl_digest(base64url_encode(random_bytes(12)), 'sha256'), - 'vtr' => '["Cl.Cm.P2"]', - 'ui_locales' => $uiLocale, - 'claims' => '{"userinfo":{"https://vocab.account.gov.uk/v1/coreIdentityJWT": null}}', + 'scope' => 'openid email', + 'state' => base64url_encode(random_bytes(12)), + 'redirect_uri' => '/lpa/dashboard', + 'nonce' => openssl_digest(base64url_encode(random_bytes(12)), 'sha256'), + 'vtr' => '["Cl.Cm.P2"]', + 'ui_locales' => $uiLocale, + 'claims' => '{"userinfo":{"https://vocab.account.gov.uk/v1/coreIdentityJWT": null}}', ] ); } diff --git a/service-api/app/test/AppTest/Service/Authentication/OneLoginAuthorisationRequestServiceTest.php b/service-api/app/test/AppTest/Service/Authentication/OneLoginAuthorisationRequestServiceTest.php index fce627ad1d..6ff1501f7d 100644 --- a/service-api/app/test/AppTest/Service/Authentication/OneLoginAuthorisationRequestServiceTest.php +++ b/service-api/app/test/AppTest/Service/Authentication/OneLoginAuthorisationRequestServiceTest.php @@ -50,5 +50,6 @@ public function create_authorisation_request(): void $this->assertStringContainsString('scope=openid+email', $authorisationRequest); $this->assertStringContainsString('vtr=%5B%22Cl.Cm.P2%22%5D', $authorisationRequest); $this->assertStringContainsString('ui_locales=en', $authorisationRequest); + $this->assertStringContainsString('redirect_uri=%2Flpa%2Fdashboard', $authorisationRequest); } }