I'm pretty certain the answer is no, that scope is baked into the token, and to change it/set a new scope you'd need to generate a fresh token with the new scope.
Jun 12, 2022
7
Level 9
Laravel Passport Token Scope
Is there a way to change scope of a generated password grant token
Password grant token generated:
Http::asForm()->post(env('PASSPORT_ISSUE_TOKEN_URL'), [
'grant_type' => 'password',
'client_id' => env('PASSPORT.PASSWORD_GRANT_CLIENT_ID'),
'client_secret' => config('PASSPORT.PASSWORD_GRANT_CLIENT_SECRET'),
'username' => $request->input('email'),
'password' => $request->input('password'),
'scope' => 'view-post'
])
I want to change the scope after a user do some action
Please or to participate in this conversation.