the same way the sdk does it just for testing but i did it actually i am using the sdk for the oauth
The way it works for the SDK is the user is redirected back to an oauth2 success page where the secret for the cookie is in the url. Then, the user is redirected into the app where the app can pull the secret out from the url and save it.
So, instead, you can redirect to your own deep link and then pull out the value yourself. You just need to redirect to /auth/oauth2/success
provider: 'google',success: "https://appwrite.hordevfree.online/v1/auth/oauth2/success"
);```
Thank you, correct, I had read something about it but the truth is that I cannot understand very well how to do it. Should I just put the url? or I also need to create some content in that url
I suppose the url must have code that redirects to the app sending this cookie, am I okay?
Look into deep linking
The url should link into the app
Thanks, it worked for me using deep links. Although it is not a pleasant way for the user because the screen flashes at the end of the login since a new instance of the application is created instead of just closing the browser.
what do you mean? what flash?
To this black screen, which is because it only works for me on android:launchMode="standard"
Of course this no longer has to do with appwrite, but hey I'm fighting to make it look good. According to what I read, it is solved with the onNewIntent() method, but I still haven't succeeded
I see...I think we typically do android:launchMode="singleTop"
. Can you do that?
Correct, but it doesn't work for me android:launchMode="singleTop"
, it keeps loading the google account selection page and doesn't return to the application. I'll keep trying anyway π
Are you still calling this?
final data = await account.createOAuth2Session(
provider: 'google',
success: "https://hordevfree.online/auth/oauth2/success");
I had to use another page because appwrite. the assetlinks.json did not work
I wonder if you need to use something else other than our SDK π§
π Well, I needed cloud but without the offline mode it doesn't work for me.
i mean maybe you can just open the browser
ooh good but I don't think that generates the problem. Or maybe because when I give the account I want to log in with twice android:launchMode="singleTop" it works
I'll try
Thanks for everything, I finally did it using the same code from the sdk; with the FlutterWebAuth2
package you save a lot of work because I don't try it before π
Ah right I guess that's an option
[SOLVED] How get cookie of oauth google session
Recommended threads
- Apple OAuth Scopes
Hi Hi, I've configured sign in with apple and this is the response i'm getting from apple once i've signed in. I cant find anywhere I set scopes. I remember se...
- Sign In With Apple OAuth Help
Hi All! I've got a flutter & appwrite app which Im trying to use sign in with apple for. I already have sign in with google working and the function is the sam...
- [SOLVED] OAuth With Google & Flutter
Hi all, I'm trying to sign in with google and it all goes swimmingly until the call back. I get a new user created on the appwrite dashboard however the flutte...