In my application I have created a marketplace application which uses
'https://www.googleapis.com/auth/userinfo.email'
'https://www.googleapis.com/auth/userinfo.profile'
Now as per google will close userinfo
endpoint. I am trying to change both scope to it's equivalent scope 'email' and 'profile'. Now when I try to refresh user's token with new scope. I am getting below error
{
"error" : "access_denied",
"error_description" : "Requested client not authorized."
}
I am using below code to refresh user's token
new Builder().setTransport(NET_HTTP_TRANSPORT)
.setJsonFactory(JACKSON_FACTORY)
.setServiceAccountId(googleOAuthService.getServiceClientEmail())
.setServiceAccountScopes(googleOAuthService.getScopes())
.setServiceAccountUser(email)
.setServiceAccountPrivateKeyFromP12File(keyFile);
I can't change scope to https://www.googleapis.com/auth/plus.me
as it will show consent screen again.
I think I need to add 'email' and 'profile' scope in google project marketplace sdk configuration but it gives me error that given scope is not valid.
Anyone please help me how I can fix it. Thanks in advance