Custom scope on login #12
Replies: 2 comments 7 replies
-
Hi Philippe, Im not sure that its supported directly by google sadly 😢 So sadly it seems you have to use a custom auth flow with a composable to achieve this. But if you find any way to do this with the default google rendered button let me know, I will add that to the library |
Beta Was this translation helpful? Give feedback.
-
I think this topic warrants a revisit. True, Google has separated sign-in from auth APIs and libraries. But you can indeed bring the two together achieve sign-in and auth consent in a single user step/flow. And in fact, it's right here in Googles main example (for the people API, but applies to other apis) https://developers.google.com/people/quickstart/js#set_up_the_sample I loaded this, ran perfectly. No problem. Not only does this approach get scopes into the sign-in process, but it also optionally lets you immediately call your API (so, ONE tap = sign-in + give consent + call API). It uses a callback from google.accounts.oauth2.initTokenClient in order to achieve that (the callback and calling of the API immediately is of course optional). @kasvith I think vue3-google-signin should support this, as UX (friction-free auth) is super important. But even if you don't... at least devs should be aware that it is possible (me being new to google apis, I had to really hunt for hours for this, as most samples and docs out there are targeting the old unsupported way!). |
Beta Was this translation helpful? Give feedback.
-
Hi,
I couldn't see a way throught the component to set the scope we would want the end user to consent. Did I miss something ?
I know I could use a custom button to achieve it but I'd like to use the standard Google Sign in button.
Thanks
Best regards,
Philippe
Beta Was this translation helpful? Give feedback.
All reactions