Skip to content

fetchUserInfoWithToken() return null after successful Google login #25

Closed Answered by ambikaaSharma
AlbertoMoricca asked this question in Q&A
Discussion options

You must be logged in to vote

Hi,

Datamweb\ShieldOAuth\Libraries\GoogleOAuth::fetchUserInfoWithToken(): Return value must be of type object, null returned

We resolve this error by changing Curl Request form "GET" to "POST",

PROJECT-PATH/vendor/datamweb/shield-oauth/src/Libraries/GoogleOAuth.php

 protected function fetchUserInfoWithToken(): object
    {
        // send request to API URL
        try {
            $response = $this->client->request('**POST**', self::$API_USER_INFO_URL, [
                'headers' => [
                    'Accept'        => 'application/json',
                    'User-Agent'    => self::$APPLICATION_NAME . '/1.0',
                    'Authorization' => 'Bearer ' . $this->getToken(),
   …

Replies: 6 comments 11 replies

Comment options

You must be logged in to vote
1 reply
@AlbertoMoricca
Comment options

Comment options

You must be logged in to vote
2 replies
@datamweb
Comment options

@AlbertoMoricca
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@datamweb
Comment options

@AlbertoMoricca
Comment options

@ambikaaSharma
Comment options

Comment options

You must be logged in to vote
4 replies
@datamweb
Comment options

@AlbertoMoricca
Comment options

@ambikaaSharma
Comment options

@AlbertoMoricca
Comment options

Answer selected by AlbertoMoricca
Comment options

You must be logged in to vote
1 reply
@datamweb
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants