Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google Provider Execption: Argument 1 passed to League\OAuth2\Client\Provider\AbstractProvider::setResultUid() must be of the type array, null given, #183

Closed
ketanshah79 opened this issue Dec 11, 2014 · 2 comments

Comments

@ketanshah79
Copy link

Hi there,

I am in process of integrating oauth2-client into my laravel app. I am using the "Authorization Code Flow" https://github.com/thephpleague/oauth2-client#authorization-code-flow to setup Google. I've setup correct client id/ secret from google. When google hits back on my callback url I get the following Error Exception

"Argument 1 passed to League\OAuth2\Client\Provider\AbstractProvider::setResultUid() must be of the type array, null given, called in /private/var/www/mrk/mockup-app/vendor/league/oauth2-client/src/Provider/AbstractProvider.php on line 215 "

Screenshot attached. Any help would be appreciated.

ss_ 2014-12-11 at 4 11 48 pm

@ketanshah79
Copy link
Author

I've figured out the issue.

I was not omitting one of these

// Try to get an access token (using the authorization code grant)
$token = $provider->getAccessToken('authorization_code', [
    'code' => $_GET['code']
]);

// If you are using Eventbrite you will need to add the grant_type parameter (see below)
$token = $provider->getAccessToken('authorization_code', [
    'code' => $_GET['code'],
    'grant_type' => 'authorization_code'
]);

All good now.

Thank you

@ramsey
Copy link
Contributor

ramsey commented Dec 11, 2014

Good to hear. :-)

On Dec 11, 2014, at 06:11, ketanshah79 notifications@github.com wrote:

I've figured out the issue.

I was not omitting one of these

// Try to get an access token (using the authorization code grant)
$token = $provider->getAccessToken('authorization_code', [
'code' => $_GET['code']
]);

// If you are using Eventbrite you will need to add the grant_type parameter (see below)
$token = $provider->getAccessToken('authorization_code', [
'code' => $_GET['code'],
'grant_type' => 'authorization_code'
]);
All good now.

Thank you


Reply to this email directly or view it on GitHub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants