nativescript-oauth2 icon indicating copy to clipboard operation
nativescript-oauth2 copied to clipboard

Google Oauth Couldn't get user profile information such as fullname and profile pic

Open ilkan opened this issue 4 years ago • 3 comments

On IOS, I'm trying to get user fullname and profile pic after google auth. With below config, I'm using idtoken to get these data. Scope in Google Console are Oauth openid, email and profile

https://oauth2.googleapis.com/tokeninfo?id_token=+<ID_TOKEN>

returns email and other staff only

exports.configureOAuthProviders = configureOAuthProviders;
function configureOAuthProviderGoogle() {
    var googleProviderOptions = {
      openIdSupport: "oid-full",
      clientId: "<project-id>.apps.googleusercontent.com",
      redirectUri: "com.googleusercontent.apps.<project-id>:/auth",
      urlScheme: "com.googleusercontent.apps.<project-id>",
     scopes: ["openid","email","profile"]
    };
    var googleProvider = new providers_1.TnsOaProviderGoogle(googleProviderOptions);
    return googleProvider;
}

ilkan avatar Jul 14 '20 15:07 ilkan

Yes, Same issue I am facing too. In the result object, I am just getting the value of accessToken, accessTokenExpiration, idToken, idTokenExpiration, refreshToken, refreshTokenExpiration. Not able to get user info like name, email, profile. Even I gone through youtube demo tutorial : https://www.youtube.com/watch?v=Ix0bXZeyhK0&list=PLPZA5f_u3nIb7HDwaocdGB3qpSlpYhdBa&index=2&t=1141s

but did not get the result.

omprakashgupta avatar Sep 07 '20 09:09 omprakashgupta

same here

PhilippS93 avatar Dec 18 '20 13:12 PhilippS93

Getting the same issue here too, and unsure on how to fix. Is the project actively maintained?

tinybigideas avatar May 14 '21 05:05 tinybigideas