Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IdToken is not available when doing Google OAuth #46

Closed
masimplo opened this issue Jul 18, 2019 · 4 comments
Closed

IdToken is not available when doing Google OAuth #46

masimplo opened this issue Jul 18, 2019 · 4 comments
Milestone

Comments

@masimplo
Copy link

I am trying to migrate from cordova-plugin-googleplus. In the previous plugin the response I was getting from logging in with google included an idToken which I sent to my server and obtained a refresh_token and the issuer additionally to all the other info I am getting now if I sent just the access_token that is returned from using this plugin.

Plugins.OAuth2Client.authenticate(
      {
        appId: this._appConfig.thirdPartyAPIs.googleOAuth.clientId,
        authorizationBaseUrl: 'https://accounts.google.com/o/oauth2/auth',
        accessTokenEndpoint: 'https://www.googleapis.com/oauth2/v4/token',
        scope: 'email profile',
        resourceUrl: 'https://www.googleapis.com/userinfo/v2/me',
        web: {
          redirectUrl: 'http://localhost:4200',
          windowOptions: 'height=600,left=0,top=0'
        },
        android: {
          appId: 'xxxx.apps.googleusercontent.com',
          responseType: 'code', // if you configured a android app in google dev console the value must be "code"
          customScheme: 'com.example.android:/'
        },
        ios: {
          appId: 'xxxx.apps.googleusercontent.com',
          responseType: 'code',
          customScheme: 'com.example.app:/'
        }
      }
    )

The response I get contains these fields:

  email: string;
  name: string;
  family_name: string;
  given_name: string;
  verified_email: boolean;
  picture: string;
  locale: string;
  id: string;
  access_token: string;
@moberwasserlechner
Copy link
Collaborator

This plugin does not support OpenID, but I created a task to check if it is really just a layer/convention on top of oauth2.

I cannot give you a timeframe until when I will be able to start working on the task, because I have very little sparetime for OSS right now.

See #49

@moberwasserlechner
Copy link
Collaborator

Starting with v2.0.0 of the plugin you have access to the id_token, if you provide no resourceUrl. The id_token includes the resource parameters anyway.

@kulkarniswapnil
Copy link

If I remove the resourceUrl I am not getting the email, name, and profile related things. Would you please help me to get both id_token and profile info? Thank you.

@moberwasserlechner
Copy link
Collaborator

moberwasserlechner commented May 28, 2020

@kulkarniswapnil Please donot comment on closed tasks and create a new task for this. Give as much information as possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants