-
-
Notifications
You must be signed in to change notification settings - Fork 151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OAuth Issue on Sign-in (Code 190) #397
Comments
@nroman446 could you try using |
I have the same error. "If you are not using limited login you will need to handle all graph..." with link to this blog [(https://developers.facebook.com/blog/post/2024/03/28/changes-made-to-fb-login-sdk/)] Regards |
6.1.1 is working as expected. Facebook backdoored the sunsetting of classic login so I suspect that's leading to the issue. edit: 6.1.1 works with classic login, it does NOT work for limited login |
In my case it fails with this same error both in versions 6.1.1 and 6.2.0
The loginResult returns success and an AccessToken, but the FirebaseAuth.instance.signInWithCredential returns:
This happens only in IOS. Android works fine |
Same error here! |
@pamafe1976 @bdezso Did you try changing it to 6.1.1 on both |
@shamjam you're right that after downgrading in pubspec.yaml to 6.1.1, the podfile.lock was still in 6.2.0 I don't know why it goes to 6.0.4 instead of 6.1.1. If I try to force it to 6.1.1, I get an error when running pod install |
@pamafe1976 , try |
@shamjam Thanks for the tip. It's working now. I had to update the .lock file too. |
I believe I have figured out the issue. FacebookAuth at line 90 only provides the providerid and accesstoken. oauth for limited login requires the raw nonce |
the same is report here #396 |
Is your problem solved? I am getting same problem for iOS version 17.0 and above |
Please add more context and how the issue could be fixed. |
https://firebase.google.com/docs/auth/ios/facebook-login |
I will check it and try to deploy a pre-release version |
I have deployed a pre-release version of the limited login on iOS. Please check the BREAKING CHANGES https://pub.dev/packages/flutter_facebook_auth/versions/7.0.0-dev.3/changelog#700-dev3 |
@darwin-morocho Still getting the same error. When I tried to send credential to Firebase.
|
@kamyweb following this documentation you need to pass a nonce similar to the next swift code // Initialize a Firebase credential.
let idTokenString = AuthenticationToken.current?.tokenString
let nonce = currentNonce
let credential = OAuthProvider.credential(withProviderID: "facebook.com",
idToken: idTokenString!,
rawNonce: nonce) Thus plugin now has the |
String randomNonceString({int length = 32}) { String charset =
} final nonce = sha256.convert(utf8.encode(randomNonceString())).toString(); I am passing nonce too, now facing different error. |
For limited login, aren't we supposed to pass SHA256 of raw nonce to Facebook? I noticed this in your changes.
If incorrect raw nonce is passed to Firebase, we get this Ref: https://firebase.google.com/docs/auth/ios/facebook-login#implement_facebook_limited_login
|
@nroman446 @RaghvindYadav you can use the next code final result = await FacebookAuth.instance.login();
if (result.status == LoginStatus.success){
final accessToken = result.accessToken;
final nonce = accessToken is LimitedToken ? accessToken.nonce : null;
} |
For classic token, I got this: |
Try with |
I get a similar issue: |
LimitedToken is a class |
@darwin-morocho Limited Login still not works. If I am using LoginTracking.enabled then it also through error but different |
Yes, that was from |
Try with |
@darwin-morocho still limited login not works, getting the below response. Now non limited login also get failed. |
I am not sure that the error is due to this plugin please check your configuration into the facebook and firebase console |
@darwin-morocho this flutter_facebook_auth: ^6.2.0 works fine when I added ATT prompt when user allow to track app, but login failed user revoke the tracking request. In android and web everything works good. |
I will try to reproduce the issue creating a firebase project and adding it to this repo. |
This looks to be the remaining blocker for our implementation, where Limited Logins are responding with:
|
I will add an option to pass a custom nonce and release it tomorrow |
Any update? |
https://pub.dev/packages/flutter_facebook_auth/versions/7.0.0-dev.6/changelog#700-dev6 |
Please check
|
FirebaseAuth still shows errors for limited login and enabled login. |
Sorry but I not sure if the problem is this plugin due to now youbare able to use a custom nonce for a limited login. Maybe Can you provide me a project to reproduce the issue an only replace with another credentials? |
@RaghvindYadav Future<void> signIn() async {
final oauthCredential = await signInWithFacebook();
await FirebaseAuth.instance.signInWithCredential(oauthCredential);
}
Future<OAuthCredential> signInWithFacebook() async {
final rawNonce = _generateNonce();
final nonce = _sha256ofString(rawNonce);
final result = await _facebookAuth.login(nonce: nonce);
final accessToken = result.accessToken;
if (accessToken == null) {
throw Exception('Login cancelled');
}
if (accessToken.type == AccessTokenType.limited) {
return OAuthProvider('facebook.com').credential(
idToken: accessToken.tokenString,
rawNonce: rawNonce,
);
} else {
return FacebookAuthProvider.credential(accessToken.tokenString);
}
} |
This worked for me! :) |
@jchirinosodio @naokinkfj Thank you to both, I will also try. |
Again problem happening for limited login. I am not cancelling Facebook login but it say |
Could add some project to reproduce your issue? |
Hello guys, Same problem here with iOS and 7.0.0-dev.3, getting an accessToken, when trying to verify it in : https://developers.facebook.com/tools/debug/accesstoken/ Getting : { Found this on flutter_login_facebook docs : WARNING! Important Changes in SDK v17.0 for iOS (plugin version 2.0.0) Limited Login Mode: If the user has not granted the AdvertiserTracking permission (Apple documentation, Facebook documentation), the login process will now enter a Limited Login mode. This mode is indicated by the isLimitedLogin field in the AccessToken object. |
saved my life |
Here is mine although I do not use Firebase for the login:
|
@JasperElton Works for me too!!! |
What version are you using?
6.2.0
What OS and version are you using to local deploy your application?
MacOS Sonoma 14.0
What platforms are you seeing the problem on?
iOS
pubspec.yaml
Describe the Bug
Attempting to login via facebook via FBSDK Login Kit facebook will spit out error [firebase_auth/invalid_credential]{"code":190,"message":"Invalid OAuth access token - Cannot parse access token"}
Expected Behavior
The facebook login popup should clear
To Reproduce
Log In via FacebookAuth.login()
Relevant log output
No response
flutter doctor -v
Info.plist (iOS)
Podfile (iOS)
AndroidManifest.xml
No response
MainActivity.java
No response
MainActivity.kt
No response
index.html
No response
Info.plist (macOS)
No response
The text was updated successfully, but these errors were encountered: