google / GoogleSignIn-iOS

Enables iOS and macOS apps to sign in with Google.
https://developers.google.com/identity/sign-in/ios
Apache License 2.0
476 stars 192 forks source link

How to add prompt: consent to user auth flow? #112

Open mikeyyyzhao opened 2 years ago

mikeyyyzhao commented 2 years ago

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

}
petea commented 2 years ago

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?

mikeyyyzhao commented 2 years ago

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.

pradeep-orbi commented 2 years ago

Any update on this ?

jmagman commented 2 years ago

@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 commented 2 years ago

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

pradeep-orbi commented 2 years ago

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

I just want to set prompt value.

jmagman commented 2 years ago

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 🙂

mikeyyyzhao commented 10 months ago

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.

EriemHarris commented 2 months ago

Is there an update on this? With the changes to the new Google Sign In experience, users see a confusing message upon re-signing in (sign out and sign back in) where they are told additional access is being requested even though it's not. Adding prompt: consent fixes this issue. The issue exists in the DaysUntilBirthday sample. To reproduce: sign in, sign out, and sign in again and you will a screen like this.

Days Until Birthday sign in again