1
Google OAuth2.0을 로그인 프레임 워크로 사용하는 웹 기반 응용 프로그램이 있습니다. 그것은 어제까지 멋지게 이전에 작동합니다. 액세스 토큰이 만료 된 후 응용 프로그램에서 새로 고침 토큰을 가져올 수 없습니다.OAuth 2.0 새로 고침 토큰을 사용할 수 없습니까?
어떻게하면 다음 오류를 제거 할 수 있습니까?
**PHP Fatal error**: Uncaught exception 'Google_AuthException' with message 'The OAuth 2.0 access token has expired, and a refresh token is not available.
다음은 내 코드입니다 :
if (isset($_GET['code'])) {
$client->authenticate($_GET['code']);
$_SESSION['access_token'] = $client->getAccessToken();
header('Location: ' . filter_var($redirect_uri, FILTER_SANITIZE_URL));
}
if (isset($_SESSION['access_token']) && $_SESSION['access_token']) {
$client->setAccessToken($_SESSION['access_token']);
}