oauth-4-laravel icon indicating copy to clipboard operation
oauth-4-laravel copied to clipboard

Save the accesstoken? Getting: Call to undefined method OAuth\OAuth2\Service\Facebook::getAccessToken()

Open simplenotezy opened this issue 11 years ago • 2 comments

I wish to save the access token for Facebook in the users table, so I later can query the users facebook.

How is this accomplished? I have tried with:

            $fb = OAuth::consumer( 'Facebook' );
            $fb->getAccessToken();

But that generates this error:

Call to undefined method OAuth\OAuth2\Service\Facebook::getAccessToken()

What do I do wrong?

simplenotezy avatar Oct 03 '14 18:10 simplenotezy

Solved.

Get access token like this:

                    $token = $fb->requestAccessToken( $code );

                    dd($token->getAccessToken());

simplenotezy avatar Oct 03 '14 18:10 simplenotezy

confiax please help me what value have to be passed from the input code to access the $token value i am stuck there

shamshi1988 avatar Oct 11 '15 08:10 shamshi1988