Facebook Login - Obtain null Authentication token
Checklist before submitting a bug report
- [X] I've updated to the latest released version of the SDK
- [X] I've searched for existing Github issues
- [X] I've looked for existing answers on Stack Overflow, the Facebook Developer Community Forum and the Facebook Developers Group
- [X] I've read the Code of Conduct
- [X] This issue is not security related and can safely be disclosed publicly on GitHub
Java version
java 11.0.12
Android version
Andriod 11
Android SDK version
8.2.0
Installation platform & version
implementation 'com.facebook.android:facebook-android-sdk:latest.release'
Package
Login
Goals
have an jwt format token
Expected results
have an jwt format token
Actual results
authenticationToken is empty
Steps to reproduce
No response
Code samples & details
val fBLoginManager = com.facebook.login.LoginManager.getInstance()
fBLoginManager.registerCallback(mFaceBookCallbackManager, object : FacebookCallback<LoginResult> {
override fun onCancel() {
Log.i(TAG, "facebook: onCancel")
}
override fun onError(error: FacebookException) {
Log.i(TAG, "facebook: error$error")
}
override fun onSuccess(result: LoginResult) {
Log.i(TAG, "facebook: onSuccess")
//not empty
val accessToken = result.accessToken
//empty
val authenticationToken = result.authenticationToken
}
})
fBLoginManager.logInWithReadPermissions(mFragment.fragment, mFaceBookCallbackManager, listOf("email", "public_profile"))
I have the same issue. LoginResult returns the correct accessToken, but the authenticationToken (JWT token) is always null. Seems like a bug in the SDK. Is it possible that this will be fixed soon?
@sonjaBrzak because no documentation provided for Android ,so I understand facebook android sdk is not support OIDC ,I solve my question by google firrbase ,it can help have a JWT token。
@DRPrincess you are right, Firebase can help you get the JWT, although the issuer of that token will be google, not facebook, which could be a problem for the validation part of the token on the backend side. Did you solve that issue somehow?
I have the same issue.
Do we have any progress or information on this issue? This exact code works perfectly on iOS with iOS facebook SDK, but for android I always get null on the AuthenticationToken.getCurrentAuthenticationToken - same for loginResult.authenticationToken.
This is blocking my team from adding facebook login to the app I'm working on.
@KylinChang @carolineli @mingcaozhang
Please fix retrieval of JWT token. This issue is ongoing from version 8.0.0 up until latest (at the time of writing 16.0.0)!
It can't be that the same functionality is working on iOS SDK, but not on Android and no documentation about this exists!
Why Android SDK is being ignored?
same problem here. Please fix.
Same issue here. Does Meta have any official workaround guidance? Is it expected that we implement the flow manually (https://developers.facebook.com/docs/facebook-login/guides/advanced/oidc-token)?