artdarek / oauth-4-laravel

OAuth Service Provider for Laravel 4
684 stars 216 forks source link

Working with the Access Token #63

Open kmmathis opened 10 years ago

kmmathis commented 10 years ago

Is it possible to obtain access to the Access Token? I'm working on a project where I need to pass off the access token to my teammate who is working in Java (I know, it's weird).

$token = $googleService->requestAccessToken( $code );
dd($token->accessToken);

The error I get is:

Symfony \ Component \ Debug \ Exception \ FatalErrorException
Cannot access protected property OAuth\OAuth2\Token\StdOAuth2Token::$accessToken
sadekd commented 10 years ago

Try this dd($token->getAccessToken());

pardeep3055 commented 8 years ago

Thanks This worked for me.

MxFlorin commented 5 years ago

$accessToken->getValue(); $accessToken->getExpiresAt();