facebook / facebook-ios-sdk

Used to integrate the Facebook Platform with your iOS & tvOS apps.
https://developers.facebook.com/docs/ios
Other
7.73k stars 3.51k forks source link

Facebook SDK v11.1.0:Error Code=309 Invalid ID token from login response. #1879

Closed iHTCboy closed 2 years ago

iHTCboy commented 2 years ago

Checklist before submitting a bug report

Xcode version

12.5.1 (12E507)

Swift version

5.5

Installation platform & version

11.1.0

Package

Login

Goals

User Facebook Login API

Expected results

Login Success

Actual results

Error Domain=com.facebook.sdk.core Code=309 "(null)" UserInfo={com.facebook.sdk:FBSDKErrorDeveloperMessageKey=Invalid ID token from login response.}

Steps to reproduce

No response

Code samples & details

let loginMgr = LoginManager()
        loginMgr.logIn(permissions: [.publicProfile], viewController: vc) { [self] loginResult in
            switch loginResult {
                case .failed(let error):
                    debugPrint("facebook oauth error:\(error)")
                   // Error!!!!!
                case .cancelled:
                   break
                case .success(_, _, let token):
                   break                    
                @unknown default:
                    break
            }
        }
Xiaoyouyou commented 2 years ago

me too
Error Domain=com.facebook.sdk.core Code=309 "(null)" UserInfo={com.facebook.sdk:FBSDKErrorDeveloperMessageKey=Invalid ID token from login response.}

CainLuo commented 2 years ago

I also encountered this problem. I have seen an Issue #1651 before. It said that the system time is adjusted. However, all my test machines are in normal time and have not been adjusted. The problem also occurred. I haven't changed the code. What's the matter? @joesus

vkill commented 2 years ago

+1

iHTCboy commented 2 years ago

I also encountered this problem. I have seen an Issue #1651 before. It said that the system time is adjusted. However, all my test machines are in normal time and have not been adjusted. The problem also occurred. I haven't changed the code. What's the matter? @joesus

Yes. We have encountered a problem after upgrading from the Facebook SDK version: 9.1.0 to 11.1.0.

Currently using 9.1.0 is a normal login.

congnguyen3695 commented 2 years ago

I also encountered this problem what happened?

sandralalabear commented 2 years ago

same here sdk version 11.0.1

2353421907 commented 2 years ago

Same problem. I was able to log in yesterday sdk version 11.0.1

iHTCboy commented 2 years ago

Test results, affected versions: 11.1.0, 11.0.1, 11.0.0,

The following versions are used normally: 9.3.0, 9.2.0, 9.1.0

so bad.😔

cooljiatao commented 2 years ago

+1

mqlsq commented 2 years ago

+1

JackYin2014 commented 2 years ago

+1

ivanrein commented 2 years ago

+1. version 9.3.0, happens when facebook app is not installed

y-hakutaku commented 2 years ago

+1

khanhnq92 commented 2 years ago

+1

iHTCboy commented 2 years ago

+1. version 9.3.0, happens when facebook app is not installed

yes, same problem with web page:

  1. The user logs in to the account on Facebook.com in Safari
  2. When the app authorizes Facebook to log in, it will same reason fail.
xjpch commented 2 years ago

NSString *iss = [FBSDKTypeUtility stringValue:claimsDict[@"iss"]];

BOOL isFacebook = iss.length > 0 && [[[NSURL URLWithString:iss] host] isEqualToString:@"facebook.com"];

but iss = @"https://www.facebook.com"

foxman2 commented 2 years ago

+1

foxman2 commented 2 years ago

image The error reason is claimsDict[@"iss"] value change to https://wwww.facebook.com.

2353421907 commented 2 years ago

It seems to be working now

congnguyen3695 commented 2 years ago

i guess the developer solved it it worked! 😄

jawwad commented 2 years ago

Sorry about the inconvenience on this thank you to all of those that reported it. This was due to a server side change that was fixed shortly after being reported. However @ppansy has added a fix for this f6b3fe618cbffd2dc9d941f3cbb5935c18cdf43e so that the SDK will handle this kind of change from the server in the future.

cuzv commented 2 years ago

@jawwad This issue reproduced again right now, with all the same client conditions.

MrDML commented 2 years ago

@jawwad me too,Login failure occurs again.

ShiQiaoPan commented 2 years ago

It happened again. FBApp in development: The web version login is no problem, jump to the APP authorization and come back and report an error com.facebook.sdk.core Code=309 "(null) when facebook app is installed. FBApp in Production: There is no problem with the authorization of the web version or the jump APP when facebook app is installed.

charlescohen7 commented 2 years ago

Same problem here (again)!

jawwad commented 2 years ago

@charlescohen7, @ShiQiaoPan, @MrDML, @cuzv - Could you tell me what version of the SDK you are using?

guillahume commented 2 years ago

we're using the v11.0.0

we tried to apply this patch locally and it works https://github.com/facebook/facebook-ios-sdk/commit/f6b3fe618cbffd2dc9d941f3cbb5935c18cdf43e

but we have to submit our app to the app store again

jawwad commented 2 years ago

@guillahume - I found the backend change that is causing the issue. I'm reverting it now so this should hopefully be fixed shortly.

pantaovay commented 2 years ago

+1

jawwad commented 2 years ago

Sorry about this (again)! The fix for this has been deployed.

ppansy commented 2 years ago

For people experiencing this issue today, can you comment the FB app version you are using (if using fb app login) and the scope requested? This will help bug further debug the root cause, thank you!

cuzv commented 2 years ago

@passy SDK v11.2.0

permissions:

"instagram_basic",
"pages_show_list",
"instagram_manage_insights",
"instagram_manage_comments",
"instagram_content_publish",
"pages_read_engagement",
"pages_manage_metadata",
hawflakes commented 2 years ago

I'm getting the 309 error again with a slightly older SDK version. Should that be happening as I haven't seen any notices about requiring an upgrade.

ppansy commented 2 years ago

@hawflakes What sdk version are your using? requested permissions?

hawflakes commented 2 years ago

@ppansy We're using 11.0.1 and requesting publicProfile only. This error is happening with both the app and Safari.

ppansy commented 2 years ago

@hawflakes Sorry for responding late. We haven't seen any other reports on 11.0.1. When did you start seeing this issue? Any repro steps/sample project you could share?

hawflakes commented 2 years ago

@ppansy our support staff started seeing this issue back when I reported it. I verified that it was broken and we had to rush an app update for review. We don't use the sdk in any special way. It's requesting the above permissions for a 3rd-party auth.

ppansy commented 2 years ago

@hawflakes Was it fixed after upgrading to a new sdk version? do you mind sharing the app name/app id?

hawflakes commented 2 years ago

@ppansy it's fixed now after updating the sdk but I suppose you have bigger problems now.

RinNguyens commented 2 weeks ago

Same proplem for version 13. Platform : IOS

com.facebook.sdk:FBSDKErrorDeveloperMessageKey": "Invalid ID token from login response."

I had check fb id vs token client. But still error.