Hello, I would like some help on this error please.
My app is already using email and password sign in, but I need to add Google sign in.
I use the same cliente and account objects across the app.
I have create the credentials on the google console.
The id and secret are set on appwrite cloud.
I am not sure why I am getting this exception.
This is the code:
Future<void> signInWithGoogle() async {
final account = ref.read(accountProvider);
final result = await account.createOAuth2Session(
provider: 'google',
);
}
I am targeting all available platforms in flutter, if there is something specific I need to do for each one, please mention it.
Yes, the success and failure urls are different depending on platform. For web, see https://github.com/appwrite/sdk-for-flutter/tree/master#web
Could you please elaborate on this. I was debugging a mac app, still got the exception.
I have added all the platforms as indicated on the docs.
the web section talked about what to do for the oauth2 recirect
what's your project id?
id: linearProgrammingApp
i think the problem is the uppercase chars. could you see if doing setProject() with lowercase works?
Do i need to create a new project on appwrite where the id is all lower-case, or just change the name on the dart code
Is this cloud or self hosted
it is cloud
Then you most recreate. You won't be able to change jt
You can try changing what you pass into setProject
Ohh interesting. Its not case sensitive?
Maybe π
Well, that's acutally good to know,
My Appwrite instance is sets to utf8mb4_general_ci so it's actually case-insensitive, and my function run with upper case ids.
And it should work also with the cloud.
Just changing the string to lowercase on dart, apparently worked, because the browser window appeared and allowed me to authenticate, but I am still getting an exception. Not sure why
final account = ref.read(accountProvider);
final result = await account.createOAuth2Session(
provider: 'google',
);
final accountAfter = await account.get();
debugPrint('google account: ${accountAfter.email}');
}```
Is this Android?
Exception:
AppwriteException: general_unauthorized_scope, User (role: guests) missing scope (account) (401) ```
I need to make it work on all platforms, but was testing on macos, web still tell me that I need to correctly set up the redirection link
Should I still re-create the appwrite project? or because the authentication window opened, is not necessary
Recommended threads
- Appwrite (Dart SDK) (for package_info_pl...
Hi team! Many Flutter plugins now need package_info_plus 10.x and device_info_plus 13.x, but appwrite 25.4.0 still constrains package_info_plus: >=8.0.2 <10.0...
- Images/Videos in storage appearing broke...
I am running into a storage issue after upgrading my self-hosted Appwrite instance , all of my previously uploaded images and videos are now showing as broken i...
- executeFunction intermittently throws Fo...
Environment: Flutter app using the Appwrite Flutter SDK, calling executeFunction for [describe endpoint, e.g. live-stream-related function]. *Description*: Int...