-
-
Notifications
You must be signed in to change notification settings - Fork 272
Closed
Labels
authThis issue or pull request is related to authenticationThis issue or pull request is related to authenticationbugSomething isn't workingSomething isn't workingdocumentationImprovements or additions to documentationImprovements or additions to documentation
Description
Describe the bug
I’m confused about whether signInWithIdToken supports Facebook.
According to the docs: https://supabase.com/docs/reference/dart/auth-signinwithidtoken
It mentions Facebook as one of the supported providers.
However, when I try using it, I get this error:
flutter: Error login with Facebook, AuthException(message: Provider must be google, apple, kakao or keycloak., statusCode: null, code: null)
My code:
///
Future<AuthResponse> facebookSignIn() async {
// Use [package:flutter_facebook_auth] for more control of authentication flow
try {
final result = await FacebookAuth.instance.login(
permissions: ["email", "public_profile"],
);
//
if (result.status == LoginStatus.success) {
final accessToken = result.accessToken!.tokenString;
// Login to Supabase after successfully logging in with Facebook
return Supabase.instance.client.auth.signInWithIdToken(
provider: OAuthProvider.facebook,
idToken: accessToken,
);
} else {
throw Exception("Facebook login failed, ${result.status}");
}
} catch (err) {
rethrow;
}
}supabase_flutter: ^2.9.0
Metadata
Metadata
Assignees
Labels
authThis issue or pull request is related to authenticationThis issue or pull request is related to authenticationbugSomething isn't workingSomething isn't workingdocumentationImprovements or additions to documentationImprovements or additions to documentation