Skip to content
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

fix(authentication): explicitly request Google auth token with provided scopes on Android #726

Merged
merged 5 commits into from
Sep 24, 2024

Conversation

nkalupahana
Copy link
Contributor

@nkalupahana nkalupahana commented Sep 22, 2024

This PR explicitly requests scopes when getting a Google access token post-Sign In with Google.

It looks like not requesting scopes explicitly works most of the time, but not all of the time. I had two users with this bug (nkalupahana/baseline#402), and this change fixed it for them (patch). This PR upstreams our patch.

Closes #725

Pull request checklist

  • The changes have been tested successfully.
  • A changeset has been created (npm run changeset).
  • I have read and followed the pull request guidelines.

Copy link

pkg-pr-new bot commented Sep 22, 2024

Open in Stackblitz

@capacitor-firebase/analytics

npm i https://pkg.pr.new/capawesome-team/capacitor-firebase/@capacitor-firebase/analytics@726

@capacitor-firebase/app

npm i https://pkg.pr.new/capawesome-team/capacitor-firebase/@capacitor-firebase/app@726

@capacitor-firebase/app-check

npm i https://pkg.pr.new/capawesome-team/capacitor-firebase/@capacitor-firebase/app-check@726

@capacitor-firebase/authentication

npm i https://pkg.pr.new/capawesome-team/capacitor-firebase/@capacitor-firebase/authentication@726

@capacitor-firebase/crashlytics

npm i https://pkg.pr.new/capawesome-team/capacitor-firebase/@capacitor-firebase/crashlytics@726

@capacitor-firebase/firestore

npm i https://pkg.pr.new/capawesome-team/capacitor-firebase/@capacitor-firebase/firestore@726

@capacitor-firebase/functions

npm i https://pkg.pr.new/capawesome-team/capacitor-firebase/@capacitor-firebase/functions@726

@capacitor-firebase/messaging

npm i https://pkg.pr.new/capawesome-team/capacitor-firebase/@capacitor-firebase/messaging@726

@capacitor-firebase/performance

npm i https://pkg.pr.new/capawesome-team/capacitor-firebase/@capacitor-firebase/performance@726

@capacitor-firebase/remote-config

npm i https://pkg.pr.new/capawesome-team/capacitor-firebase/@capacitor-firebase/remote-config@726

@capacitor-firebase/storage

npm i https://pkg.pr.new/capawesome-team/capacitor-firebase/@capacitor-firebase/storage@726

commit: 8be3cec

Copy link
Member

@robingenz robingenz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a private method List<String> getScopesAsList(@NonNull PluginCall call) to reduce duplicate code.

@nkalupahana
Copy link
Contributor Author

@robingenz all set!

Copy link
Member

@robingenz robingenz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@robingenz robingenz changed the title fix(authentication): Explicitly request scopes when requesting Google access token fix(authentication): explicitly request Google auth token with provided scopes on Android Sep 24, 2024
@robingenz robingenz merged commit 5729328 into capawesome-team:main Sep 24, 2024
2 checks passed
@github-actions github-actions bot mentioned this pull request Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug(authentication): Google access token sometimes does not have scopes requested on sign-in
2 participants