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

Facebook Token Problem

Open anosim opened this issue 11 years ago • 2 comments

When i use: $token = $facebookService->getStorage()->retrieveAccessToken('Facebook');

Error: Call to a member function getStorage() on a non-object

if i use this method: $token = $fb->requestAccessToken( $code );

it is returned Protected Array, i want to Token String to save my Database

Any Solution for Token as String form for save Database

Thanks

anosim avatar Feb 04 '14 15:02 anosim

try with the below statement. It will fetch the accesstoken string for you.

 $accessToken=$token->getAccessToken(); 

manik005 avatar Feb 27 '14 15:02 manik005

Just making sure I have this right... We should be using:

$fb->getStorage()->retrieveAccessToken('Facebook')->getAccessToken();

ajschmaltz avatar Mar 13 '14 15:03 ajschmaltz