You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am currently working on mixing custom Google API calls alongside the existing Socialite implementation. As part of requesting additional scopes (using Google's incremental authorization), I would like the possibility of seeing all scopes given by the current access token. These are returned in the ->getAccessTokenResponse() method under the scope method.
Since this is part of the guidelines on the access token response (OAuth2 simplified), I think it would be beneficial to add this to the whole AbstractProvider class. I'm not good at PRs so some ideas here:
In Two/AbstractProvider.php@user, before the return, add
/** * The user's granted scopes. * * @var array */public$scopes;
/** * Set the scopes that the access token has permission for. * * @param array $scopes * @return $this */publicfunctionsetScopes($scopes)
{
$this->scopes = $scopes;
return$this;
}
The only missing part of the puzzle is how to track which scopes should be set if the scopes match what was requested and no scopes field is placed. It looks like we'd have to insert the requested scopes into the session and pull() them like the state? But maybe I'm not seeing the correct approach here
Thanks!
The text was updated successfully, but these errors were encountered:
If we do store the scopes into session, then we won't even need the Arr::exists check - just set the default value on the Arr::get to be the $this->request->session()->pull('scopes')
Heya, I'm sorry but we currently do not have plans to work on something like this ourselves. You can always attempt a PR or look around for someone willing to co-create one. Thanks
Hello,
I am currently working on mixing custom Google API calls alongside the existing Socialite implementation. As part of requesting additional scopes (using Google's incremental authorization), I would like the possibility of seeing all scopes given by the current access token. These are returned in the ->getAccessTokenResponse() method under the
scope
method.Since this is part of the guidelines on the access token response (OAuth2 simplified), I think it would be beneficial to add this to the whole AbstractProvider class. I'm not good at PRs so some ideas here:
In Two/AbstractProvider.php@user, before the return, add
In Two/User.php, add a new method and field:
The only missing part of the puzzle is how to track which scopes should be set if the scopes match what was requested and no scopes field is placed. It looks like we'd have to insert the requested scopes into the session and pull() them like the state? But maybe I'm not seeing the correct approach here
Thanks!
The text was updated successfully, but these errors were encountered: