GoogleSignIn-iOS icon indicating copy to clipboard operation
GoogleSignIn-iOS copied to clipboard

How to add prompt: consent to user auth flow?

Open mikeyyyzhao opened this issue 2 years ago • 9 comments

We need the user to consent on every login attempt and on web you can set prompt = consent. However, I'm having a difficult time trying to achieve this on mobile. Is this implemented and if so, can someone help provide guidance on how to implement this?

Screen Shot 2022-04-05 at 10 50 59 AM

Currently, we're doing:

private lazy var configuration: GIDConfiguration = {
        return GIDConfiguration(clientID: clientID, serverClientID: serverClientId)
    }()

GIDSignIn.sharedInstance.signIn(with: configuration,
                                        presenting: rootViewController) { user, error in

}

mikeyyyzhao avatar Apr 05 '22 14:04 mikeyyyzhao

At the moment, it's not possible to set the prompt parameter via Google Sign-In. Can you tell me more about your use case here?

petea avatar Apr 07 '22 08:04 petea

Apologies for the delayed response. The reason we want this is if the user initially declines certain scopes and then later wants to enable those scopes, they're unable to right now.

mikeyyyzhao avatar Apr 22 '22 18:04 mikeyyyzhao

Any update on this ?

pradeep-orbi avatar Jul 13 '22 17:07 pradeep-orbi

@petea there was a similar request in the Flutter issue tracker for prompt=select_account for internal user types (https://stackoverflow.com/a/58413506). https://github.com/flutter/flutter/issues/106544 and https://github.com/google/GoogleSignIn-iOS/compare/main...umbrellait-timur-khismatullin:fix-internal-mode-reauth-issue

jmagman avatar Jul 14 '22 01:07 jmagman

Would you prefer a new issue for that, or does this include just setting valid prompt values?

jmagman avatar Jul 14 '22 01:07 jmagman

Would you prefer a new issue for that, or does this include just setting valid prompt values?

I just want to set prompt value.

pradeep-orbi avatar Jul 14 '22 04:07 pradeep-orbi

Would you prefer a new issue for that, or does this include just setting valid prompt values?

I just want to set prompt value.

I meant that question for @petea 🙂

jmagman avatar Jul 14 '22 21:07 jmagman

Any update on this? prompt is critical since if the user does not consent to permissions that enable auto refresh tokens. If the prompt is not set to consent, the user will essentially be asked to re-login every ~30min since there will be no refresh token available.

mikeyyyzhao avatar Nov 03 '23 15:11 mikeyyyzhao