diff --git a/get_oauth_token.php b/get_oauth_token.php index 08ed7f17..7f4a7eb6 100644 --- a/get_oauth_token.php +++ b/get_oauth_token.php @@ -39,7 +39,7 @@ $provider = new League\OAuth2\Client\Provider\Google( if (!isset($_GET['code'])) { // If we don't have an authorization code then get one $authUrl = $provider->getAuthorizationUrl(); - $_SESSION['oauth2state'] = $provider->state; + $_SESSION['oauth2state'] = $provider->getState(); header('Location: ' . $authUrl); exit; // Check given state against previously stored one to mitigate CSRF attack @@ -59,7 +59,7 @@ if (!isset($_GET['code'])) { // echo $token->accessToken.'
'; // Use this to get a new access token if the old one expires - echo 'Refresh Token: ' . $token->refreshToken; + echo 'Refresh Token: ' . $token->getRefreshToken(); // Unix timestamp of when the token will expire, and need refreshing // echo $token->expires;