so to capture the Appwrite OAuth callback url you need to add a seperate activity tag
<activity android:name="com.linusu.flutter_web_auth_2.CallbackActivity" android:exported="true">
<intent-filter android:label="flutter_web_auth_2">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="appwrite-callback-[PROJECT_ID]" />
</intent-filter>
</activity>
add this as a separate activity along side the existing activity tags thats there when you create the project and it should work
it's giving me option to pick rather than autodirect could it be because of multiple activity?
yup I guess
havn't seen this before
Let me know if you are able to oauth
yup seems so , anyway i have removed to other one as it was also for redirect after auth0 for another service , as i will be using appwrite the one you gave is enough , thanks!
i mean i am being redirect now to app itself but its null
idk if i need to wait or make callback
this is current code
Future<void> handelFacebookSigin() async {
final user = await account.createOAuth2Session(provider: 'facebook');
print(user);
}
when the redirect happens and logs is : I/flutter ( 9989): null
could it be beacuse the user aleardy exist , as we are using createauth?
Check if the user is being added to your appwrite project
To answer this once your app is authenticated with oauth provide you can access the user data using getAccount method
i deleted it from appwrite project
i clicked facebook login > it said i had previous logged and click continued > redirect > logs null > but looking at appwrite project the user is created and verfied
The createOAuth2Session function does not return anything
ah
To retrieve the user you have to use account.get()
after use the createOAuth2Session
That means the user is being added. You can access the user details with getAccount method
ah okay! i thought it would return with session id and use that to get data , lemme try!
and yup it's working correctly, thanks again!
should i close the post or just rename it to solved
Rename solved
Alight!
[Solved] Getting Missing Redirect on Google OAuth login
I am getting the same issue mentioned https://discord.com/channels/564160730845151244/1140629660170981416/1140653790253559829 i.e after calling createOAuth2Session its giving me option to pick rather than autodirect could it be because of multiple activity? Is there any workaround?
Please create a new post instead of posting in an old thread
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...