Skip to content

Commit

Permalink
remove superfluous comments and move redirect_uri from the client met…
Browse files Browse the repository at this point in the history
…a data to params
  • Loading branch information
MishNajam committed Oct 11, 2023
1 parent c074f90 commit 709c994
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)(),
Expand All @@ -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}}',
]
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

0 comments on commit 709c994

Please sign in to comment.