Allow only requesting the oauth scopes that an app needs
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- ios, objective-c
- Domain
- authentication, mobile
Research direction
Start with GoogleSignIn/Sources/GIDSignInInternalOptions.m and GoogleSignIn/Sources/GIDScopes.m, especially the referenced scope handling. Confirm how email and profile are added, then determine where a backwards-compatible opt-out can be exposed. Done means the default behavior is unchanged and the opt-out requests only the consuming app’s scopes.
Written by the indexing model from the issue text.
Description
Is your feature request related to a problem you're having? Please describe.
My app needs to write new files to Google Drive, and it needs nothing else. As such, the only scope I request is https://www.googleapis.com/auth/drive.file. However, the login screen suggests that the app will be much more invasive than it is:
It appears that additional scopes beyond what the consuming app requests are always requested:
https://github.com/google/GoogleSignIn-iOS/blob/main/GoogleSignIn/Sources/GIDSignInInternalOptions.m#L56
https://github.com/google/GoogleSignIn-iOS/blob/main/GoogleSignIn/Sources/GIDScopes.m#L58
Specifically it looks like the email and profile scopes are always added.
My assumption is that those additional scopes are unnecessary for basic usage, but please tell me if I am incorrect.
As an additional downside, requesting extraneous scopes makes implementing Google's new granular permissions more messy and complicated.
Describe the solution you'd like
In the spirit of the principle of least privilege, it should be possible to use Google SignIn without extraneous scopes added. To do this in a backwards compatible way, the current behavior should remain the default, but it should be possible to set a flag to avoid scopes being added.
This seems like a very small change.
Describe alternatives you've considered
First, it's possible that those other scopes are necessary for all Google API usage. However, the fact that granular permissions allows rejecting them, that seems false.
Second, it's possible that consumers of Google SignIn just live with requesting extra scopes. However, that makes their apps look more invasive than they need, and thus sketchy. Further, it means that developers need to unnecessarily handle the more complicated granular permission case where you request many scopes.
Additional context
I'm happy to contribute this feature if it would be accepted.
- Dominant language
- Objective-C
- Stars
- 751
- Forks
- 282
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 9
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from google/GoogleSignIn-iOS
-
enhancement triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
google/GoogleSignIn-iOS#621 ·
-
enhancement triage
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
google/GoogleSignIn-iOS#620 ·
-
enhancement triage
Difficulty 4/5 3-5 days Newbie friendliness 48/100
google/GoogleSignIn-iOS#611 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
google/GoogleSignIn-iOS#607 ·
-
enhancement triage
Difficulty 4/5 3-5 days Newbie friendliness 52/100
google/GoogleSignIn-iOS#602 ·
All issues in google/GoogleSignIn-iOS
Similar issues
-
clawsweeper:source-repro impact:other issue-rating: 🦞 diamond lobster P2
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
openclaw/openclaw-facetime#40 · 2 comments · 1 reaction ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
noah-nuebling/mac-mouse-fix#2054 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
obsproject/obs-studio#13918 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
SwiftOldDriver/iOS-Weekly#5439 · 1 comment ·