-
Notifications
You must be signed in to change notification settings - Fork 205
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
If user doesn't accept additional additional (not necessary scopes), return access_denied #370
Comments
Hi, thanks for the issue! Unfortunately I'm unable to test/repro this so far. Is the screenshot you shared above from the screen that looks like this?: Are you able to reproduce the issue in the sample apps (in this folder)? If not, would you be able to answer the following:
|
I've added our code for auth for reference (you just need to plug in your Steps to reproduce:
Note: if you remove access to the app through accounts.google.com -> third party access -> remove access to the app, you can repeat the steps above using the same email so this way, you don't have to recreate emails to test. Are there more details about the error (is there additional error info beyond access_denied)?
Do you get the bug if you accept a subset of the additional scopes? What about if you accept all of the additional scopes?
|
Thank you @ywsang! Let me know if there's anything else that I can provide that could be helpful |
Hi @mikeyyyzhao! I did some research and have learned that it's the expected behavior for the Google OAuth server to return an access_denied error if no new consent is granted (which is the error being propagated back to you via the GoogleSignIn-iOS library). Is there a specific reason why you need to ask for non-consented scopes on the user signing-in again? It seems that the recommendation would be to separate sign-in from the request for additional scopes, so that if the user signs out, signing in again does not ask for additional access (and the result would be a successful re-sign in). There's some additional guidance in the documentation here: https://developers.google.com/identity/protocols/oauth2/policies#unbundled-consent. I'm still working to understand what the expectation here would be for the GoogleSignIn-iOS library. Could you let me know more about the specific integration that you're using for Google Sign In on the web, i.e. which SDK you're using, version info, etc? |
@ywsang since the user is logged out, there's no way for us to know what the user has accepted? Therefore, we always show the default set of permissions that we need. GoogleSignIn-iOS has tried to separate the two steps in the past but reverted because it provides a terrible user experience. Also, following the same steps above on web produces a valid auth code. We're not using a sdk for web but just a redirect URL
If the user accepts the same scopes as before, it should keep granting the auth code. I don't fully understand how/why not granting it would be the expected behavior. |
@ywsang just following up on this as this bug is critical for apps that have are on both mobile and web |
Hi @mikeyyyzhao, sorry for the delay here! I've confirmed that this is the intended behavior of GoogleSignIn-iOS. As you've mentioned, this doesn't provide the best experience for the user, but while we are exploring how we may improve the end user experience, the current recommendation remains that you separate user sign-in from the request for scopes. I understand that this experience may not be the most ideal, but it is the current best practice and will at least unblock the sign-in experience for your app. |
Describe the bug
If a user does not accept the additional scopes. E.g. Calendar access but not contacts, the login module returns
access_denied
instead of the auth token.However, for new users accepting scope (first time logging into an app), if the user doesn't accept the additional scopes, auth continues fine and returns the token. This bug only happens on subsequent tries when the user is prompted with additional scopes and do not accept them.
The exact same flow is working fine on web on first and nth try.
To Reproduce
Steps to reproduce the behavior:
access_denied
errorExpected behavior
A clear and concise description of what you expected to happen.
For additional scopes, it should still return the user object with serverAuthCode, similar to how it works on web.
Environment
The text was updated successfully, but these errors were encountered: