Hello there all, anybody has done any social login...
# compose-desktop
s
Hello there all, anybody has done any social login (Google/Apple) in a KMM Desktop app? I already have a KMM project in Android and iOS with more than 20k users and I want to allow them to login in the new desktop app that I am building, but I cannot find an easy way to allow them authenticating with Google or Apple. Appreciate the help in advanced.
a
I haven't tried that before but you could build your own solution, you can start by open the link in the browser or webview as a window, redirect to the server and then to the desktop application using dynamic/link/universal link Might be used as a reference: https://developers.google.com/identity/sign-in/web/server-side-flow https://developers.google.com/identity/protocols/oauth2/native-app
s
Thanks a lot @Ahmed Riyadh for the reply.
Do the webviews already work for desktop then?
It seems that I will need to start working on what you suggested if there is no other options around.
Quite complex for such an easy feature in Mobile.
This is a Multiplatform library, work for iOS, Android and Desktop, it will delegate to the native solution
s
Will try that just now for desktop, many thanks.
a
Also I have an example repository for only using WebView for compose desktop: https://github.com/ellet0/compose-desktop-webview
But it's quite outdated and it's not a library, just an example
s
Ah right, will check it either way.
a
And it uses JavaFx with Compose desktop
s
Is that how you did the Google SSO in your project?
a
To be honest, I never really developed or tried using Google sign in desktop other than (https://pub.dev/packages/google_sign_in) and it's only available for macOS and only for Flutter but that's a good idea, I might create an example repository for using it in both Flutter Desktop and Compose Desktop when the time allow me doing that.
The Google Sign In docs already has info on how it work and based on that you will implement the solution, you will need to use Google sign in web
s
Yeah, I assumed so. It's either that or create a kind of magic link for the apps to the desktop app that will be simpler and quicker for the users.
a
Yes, you don't have to use WebView in your app, it would be easier for both developers and users (also more privacy) to open a link in the browser and redirect it to the desktop app but I'm not sure if Dynamic links is supported in Compose desktop and I haven't tried it before