Skip to content

Authorization code flow keeps prompting consent screen users #1210

Open
@alejo-webel

Description

@alejo-webel

Summary
I'm using the authorization code flow as the sign in method in my Angular web app and i'm finding that after every login, the consent screen is always shown, no matter if it is the Nth sign in attempt of a same user.

According to the google documentation, I understand that this consent screen should only appear once per user (After the first token request).

Expected Behavior
The consent screen should only appear once per user.

Actual Behavior
The consent screen is appearing every time while signing in.

Code (Simplified sample)

var googleClient

function initGoogle(): void {

googleClient = google['accounts'].oauth2.initCodeClient({
          client_id: 'XXX',
          ux_mode: 'popup',
          scope:
            'https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email',
          callback: ({ code }) => {
            myAuthCodeHandler(code);
          },
        });
        
}

function triggerAuthorizationFlow(): void {

googleClient.requestCode();

}

And I'm importing the google gsi client at my head tag:

<script src="https://accounts.google.com/gsi/client" async defer></script>

Does anybody is having the same issue? I need to keep using the authorization code flow but with the expected beehaviour mentioned above.

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions