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

AuthenticationToken not returned in FB Limited Login #29

Open
Linknpay opened this issue Oct 17, 2024 · 2 comments
Open

AuthenticationToken not returned in FB Limited Login #29

Linknpay opened this issue Oct 17, 2024 · 2 comments

Comments

@Linknpay
Copy link

Linknpay commented Oct 17, 2024

Description: In the SocialLoginPlugin.swift file, the authenticationToken is not returned when performing a Facebook Limited Login. Although the token is successfully retrieved in the FacebookLoginResponse, only the accessToken and profile fields are included in the response, which prevents the front-end from accessing the authenticationToken required for further authentication steps.

This issue specifically affects scenarios where Facebook Limited Login is used.

Steps to reproduce:

Initiate a Facebook Limited Login using the SocialLoginPlugin with the limited login option set in the payload.
Observe the response object returned to the front-end.
Notice that authenticationToken is missing, while accessToken and profile are present.
Expected Behavior: The response object should include the authenticationToken field, along with the accessToken and profile, especially when using Facebook Limited Login.

Current Behavior: The authenticationToken is not returned in the login result for Facebook when using Limited Login. The relevant code section omits this field.

Affected Code: In the file SocialLoginPlugin.swift, the method handleLoginResult currently returns the following for Facebook:

else if let facebookResponse = response as? FacebookLoginResponse {
    call.resolve([
        "provider": "facebook",
        "result": [
            "accessToken": facebookResponse.accessToken,
            "profile": facebookResponse.profile
        ]
    ])
}

Proposed Fix: Modify the handleLoginResult method to include the authenticationToken in the response for Facebook Limited Login:

else if let facebookResponse = response as? FacebookLoginResponse {
    call.resolve([
        "provider": "facebook",
        "result": [
            "accessToken": facebookResponse.accessToken,
            "profile": facebookResponse.profile,
            "authenticationToken": facebookResponse.authenticationToken ?? ""
        ]
    ])
}

The authenticationToken is a critical part of Facebook Limited Login and is required for verifying the login state. Please ensure the authenticationToken is properly returned to the front-end, allowing full access to the necessary authentication details when using Facebook Limited Login.

@Linknpay Linknpay changed the title AuthenticationToken not returned AuthenticationToken not returned in FB Limited Login Oct 18, 2024
@riderx
Copy link
Contributor

riderx commented Oct 22, 2024

Thanks for the report, it should be good now !

@riderx
Copy link
Contributor

riderx commented Oct 25, 2024

i realize the return value didn't follow the definition it's now fixed

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

No branches or pull requests

2 participants