Google 플러스 API를 사용하는 Android 앱이 있으며 사용자 정보를 얻기 위해 oauth 2.0 API 호출을 할 수 있도록 내 서버에 전달하는 액세스 토큰을 요청합니다. . 나는 내 서버에 도착 액세스 토큰을 전달하고GoogleAuth 액세스 토큰에 userinfo.profile 범위가 없습니다.
String scopes = "oauth2: https://www.googleapis.com/auth/userinfo.profile
https://www.googleapis.com/auth/userinfo.email
https://www.googleapis.com/auth/plus.login" ;
및 API 호출합니다 : 나는 다음과 같은 범위로 GoogleAuthUtil.getToken
를 사용하여 액세스 토큰을 요청 다음과 같은 사용자 정보를 반환 https://www.googleapis.com/oauth2/v2/userinfo
: [id, email, verified, name, given_name, family_name, link, picture, gender, locale]
지금까지 그렇게 좋았습니다. 이것은 90 %의 시간 동안 작동합니다. 최근에 나는 대부분의 세부 사항이없는 사용자를 얻고 있습니다. userinfo.profile 범위가 갑자기 없음을
{
"issued_to": "534771845378-a8epgha85s5hkr3bqnsj8ihjvpl8pms.apps.googleusercontent.com",
"audience": "534771845378-ha8epgha85s5hkr3bqnsj8ihjvpl8pms.apps.googleusercontent.com",
"user_id": "103098746579631883577",
"scope": "https://www.googleapis.com/auth/plus.login https://www.googleapis.com/auth/userinfo.email",
"expires_in": 3382,
"email": "***@***.com",
"verified_email": true,
"access_type": "offline"
}
주의 사항 : 내가 그들의 액세스 토큰을 검사 할 때 나는 다음을 참조하십시오. 왜 이런 일이 일어날 수 있는지에 대한 생각은 없습니까?
소리가 약합니다. 감사! – OferM