Skip to content
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

Facebook Login - Obtain null Authentication token #1132

Open
5 tasks done
DRPrincess opened this issue Nov 7, 2022 · 8 comments
Open
5 tasks done

Facebook Login - Obtain null Authentication token #1132

DRPrincess opened this issue Nov 7, 2022 · 8 comments

Comments

@DRPrincess
Copy link

Checklist before submitting a bug report

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"))
@sonjaBrzak
Copy link

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?

@DRPrincess
Copy link
Author

@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。

@sonjaBrzak
Copy link

@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?

@ViktorAkselrod
Copy link

I have the same issue.

@Micpol
Copy link

Micpol commented Aug 11, 2023

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.

@codefluencer
Copy link

codefluencer commented Aug 17, 2023

@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?

@avlaev
Copy link

avlaev commented Nov 2, 2023

same problem here. Please fix.

@DougSig
Copy link

DougSig commented Nov 15, 2023

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)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants
@avlaev @DougSig @DRPrincess @Micpol @codefluencer @ViktorAkselrod @sonjaBrzak and others