I created a flutter/desktop app where I want to create a oauth2 login with a microsoft account, but I get an "error" so that I can login in a browser but the "success" is only in the browser and not in the desktop app... can someone tell me how I need to create the login process in flutter so it works on desktop/android/web etc.?
here is the code:
await _account.createOAuth2Session(
provider: OAuthProvider.microsoft,
success:
'http://localhost:8443/v1/account/sessions/oauth2/callback/microsoft/65eef06d684381b3ebee',
);
and as return I get following (in browser)
https://localhost/v1/account/sessions/oauth2/callback/microsoft/65eef06d684381b3ebee?code=0.AXoAMHVysJcPIE2S...
The success URL should be a part/route of your flutter app and not the appwrite instance
so it should go like this http://localhost/home ? even when it is not a web app?
so how do I logout? š
That way. You're doing it correctly
else I get the error 500
hmm so what could be the problem? it is like a 50/50 it works š
@D5 do you have an Idea why I get this error?
When do you get this? Do you have or can find some replication pattern or steps?
not really, just when I sucessfully login in Microsoft and it redirects to appwrite...
@D5 I really don't know what is wrong with my appwrite... now I also can't login with just email/password... error is: flutter: AppwriteException: general_unauthorized_scope, User (role: guests) missing scope (account) (401)
I event totally reinstalled appwrite but still have this problem...
That error means that you're logged out...
yeah, but I get this after dart
// works
await _account.createEmailPasswordSession(
email: event.email,
password: event.password,
);
// throws error
final user = await _account.get();
@D5 I mean it worked like for weeks now and just today it does not work anymore? š
Because you deleted your appwrite instance?
no, I deleted it because I thought that would fix it... just reinstalled everything...
I mean with cloud it works... just not with my localhost... I even changed the ports to 80/443...
@D5 should i run the update form 1.5.5 to 1.5.7? it might helps? š¤·
It could. However It think it's because of the domain
I'm self-hosting in a cheap VPS and it works like in cloud
@D5 okey upgraded it but did not help but I found out now we are in total chaos š on web:
- email/password login works
- microsoft login does NOT work (error 500) on Desktop (Windows)
- email/password login does NOT work (guest error)
- microsoft login does NOT work (error 500)
you mean localhost?
Recommended threads
- Apple OAuth2 "Registration Not Complete"...
I'm getting a "Registration Not Complete" error when implementing Apple Sign In OAuth2 on self-hosted Appwrite. Environment: Self-hosted Appwrite (latest), iOS...
- Migration Failed from 1.7.4 ā 1.8.1: "Co...
Hey everyone! š I'm trying to upgrade my self-hosted Appwrite from **1.7.4 to 1.8.1** and the migration is consistently failing **Environment:** - Current ve...
- redirect uri not working for OAuth with ...
I'm following this tutorial: https://appwrite.io/blog/post/google-oauth-expo#create-an-expo-app but im using an android development build instead. When I run h...