wavezync / vue3-google-signin

Google OAuth2 plugin for Vue3 Apps. This uses latest Google Identity Service Library. It also provides set of composables which can be used easily to implement different authentication strategies
https://vue3-google-signin.wavezync.com/
MIT License
161 stars 17 forks source link

Cannot login in webview (tauri) #13

Closed vincenzoml closed 2 years ago

vincenzoml commented 2 years ago

I'm trying vue3-google-signin in vue3 using tauri as a backend, but this does not work. The browser windows for authentication is opened in the embedded browser and that is disallowed by google policies, so I get an error message as in the attached screenshot.

image
kasvith commented 2 years ago

This is not a problem with this library.

It seems a problem with tauri's browser API. AFAIK it uses a native web view to build the app. This native web view might be outdated from google's perspective.

The best way to handle this is to use redirect flow by setting ux_mode to redirect and opening up the system browser to handle the authentication flow. After that, you might want to register some handler with the system to open up Tauri app and pass the obtained token. In electron, this is done using a protocol. Im not sure what to be used with Tauri.

This is how VSCode authenticates with GitHub also