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

add: [Google]prompt property on initTokenClient #588

Merged
merged 1 commit into from
Sep 22, 2022

Conversation

kattoshi
Copy link
Contributor

After signing in with Google, I wanted to omit the authentication screen and consent screen operations that are reopened when 'SocialAuthService::getAccessToken' is called.
https://developers.google.com/identity/oauth2/web/reference/js-reference#TokenClientConfig

add 'prompt' in GoogleInitOptions.

  providers: [
    CookieService,
    {
      provide: 'SocialAuthServiceConfig',
      useValue: {
        autoLogin: true,
        providers: [
          {
            id: GoogleLoginProvider.PROVIDER_ID,
            provider: new GoogleLoginProvider('xxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com',
            {
              scopes : environment.auth.scopes,
              prompt : 'none'   // '' | 'none' | 'consent' |  'select_account'
            }
            ),
          }
        ]
      } as SocialAuthServiceConfig,

After signing in with Google, I wanted to omit the authentication screen and consent screen operations that are reopened when 'SocialAuthService::getAccessToken' is called.
@brandondunc94
Copy link

This is exactly what I need, can we get this merged? Currently the double prompt is preventing users from logging in on a mobile browser. The first prompt shows up to select the google account, and then a second prompt is shown when calling getAccessToken. On a mobile browser, the second prompt does not display for some reason. I would like to avoid the second prompt altogether.

@Heatmanofurioso Heatmanofurioso merged commit 7d2d920 into abacritt:master Sep 22, 2022
@brandondunc94
Copy link

I appreciate the quick action! This is working great for me.

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

Successfully merging this pull request may close these issues.

None yet

3 participants