Skip to content

[google_sign_in] Implement canAccessScopes on mobile #124206

Closed
flutter/packages
#9267

Description

@stuartmorgan-g

flutter/packages#3461 is adding a new API, which for now is only being implemented on web. We should add mobile implementations to avoid people hitting unimplemented errors if they try to use it on mobile. See flutter/packages#3461 (comment) for initial discussion.

Activity

  1. added
    c: new featureNothing broken; request for a new capability
    platform-iosiOS applications specifically
    packageflutter/packages repository. See also p: labels.
    P2Important issues not at the top of the work list
    on Apr 5, 2023
  2. jmagman commented on Apr 5, 2023

    @jmagman
    Member

    https://github.com/flutter/packages/pull/3461/files#diff-ee105b5f152d7dbf49ec11ee1e0d3628b53dd7e2d6494df8e1def0596f99f103R449-R454

    Checks if the [_currentUser] can access all the given [scopes].
    

    Implemented in web as have all the scopes already been granted ("can access" is kind of vague imo).

    oauth2.hasGrantedAllScopes(_lastTokenResponse!, scopes);
  3. stuartmorgan-g commented on Apr 7, 2023

    @stuartmorgan-g
    ContributorAuthor

    @ditman Sounds like the docs should be adjusted here somewhat (since we've shipped the method name we'll need to keep that).

  4. jmagman commented on Apr 7, 2023

    @jmagman
    Member

    @stuartmorgan should this be dependency: android or platform-android label? I don't think we actually need anything from the Android OS folks?

  5. stuartmorgan-g commented on Apr 7, 2023

    @stuartmorgan-g
    ContributorAuthor

    Thanks. I hate that label being first 😒

  6. ditman commented on May 26, 2023

    @ditman
    Member

    @ditman Sounds like the docs should be adjusted here somewhat (since we've shipped the method name we'll need to keep that).

    @stuartmorgan What adjustments do we want to make here? I can tweak the docs in any way without having to necessarily wait for the mobile implementations!

  7. stuartmorgan-g commented on May 26, 2023

    @stuartmorgan-g
    ContributorAuthor

    I think we probably just want to change it to say something like "has been granted access to all the given [scopes]", or "has been authorized to access all the given [scopes]"; something to make it clearer that what's being checked is whether the authorization is already done.

  8. ditman commented on May 26, 2023

    @ditman
    Member

    (I've created a quick PR to update the dartdoc in a couple of places: flutter/packages#4092)

  9. 2 remaining items

  10. muzzah commented on Feb 13, 2024

    @muzzah

    Im confused with the implemnentation of this method for mobile. In the changelogs, it says this is only implemented on web and not needed for mobile. Indeed, if this is called for Mobile I get an Unimplemented exception. So how does one check if these scopes have been granted on mobile? The documentation on the method mentions no such restrictions regarding implementation for mobile.

    Would it be possible to get a clarification on the above question? Thanks

  11. leman7193 commented on May 29, 2024

    @leman7193

    The current solution is to call GET API to get list scopes from the access_token and check it again. Hope the Flutter team can finish
    https://www.googleapis.com/oauth2/v3/tokeninfo?access_token=....

  12. PresKhaled commented on Apr 9, 2025

    @PresKhaled
  13. github-actions commented on Jul 8, 2025

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  14. locked as resolved and limited conversation to collaborators on Jul 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

P2Important issues not at the top of the work listc: new featureNothing broken; request for a new capabilityp: google_sign_inThe Google Sign-In pluginpackageflutter/packages repository. See also p: labels.platform-androidAndroid applications specificallyplatform-iosiOS applications specificallyteam-ecosystemOwned by Ecosystem teamtriaged-ecosystemTriaged by Ecosystem team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions