Skip to content

Commit

Permalink
feat: Allow custom state
Browse files Browse the repository at this point in the history
  • Loading branch information
maicol07 authored Jan 26, 2022
1 parent 4d16b7b commit 11ee3e9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -312,12 +312,12 @@ public function signOut(string $id_token, ?string $redirect=null): void
*
* @throws Exception
*/
public function getAuthorizationUrl(?array $query_params=null): string
public function getAuthorizationUrl(?array $query_params=null, ?string $state=null): string
{
$auth_endpoint = $this->authorization_endpoint;

// State essentially acts as a session key for OIDC
$state = Str::random();
$state = $state ?? Str::random();
Session::set('oidc_state', $state);

$params = collect([
Expand Down

0 comments on commit 11ee3e9

Please sign in to comment.