Passport - State session value Hi, I'm testing Passport. I'm using code from official doc and I have problem with the 'state' variable.
My consumer app put the state on session. After redirect and login, in session there isn't state value, so the application return InvalidArgumentException.
Documentation Link:
https://laravel.com/docs/master/passport#requesting-tokens
I'm using php 7.3.8 and I'm running two laravel applications with artisan serve.
@danieletulone What session driver are you using in your env file? Try using cookie.
Maybe try defining state before using it at all.
$state = Str::random(40);
$request->session()->put('state', $state);
$query = http_build_query([
'client_id' => 'client-id',
'redirect_uri' => 'http://example.com/callback',
'response_type' => 'code',
'scope' => '',
'state' => $state,
]);
Thanks but it doesn't work. In redirect I have the 'state' key with value in the url.
The consumer application doesn't find 'state' from session.
Please sign in or create an account to participate in this conversation.