• Resolved mishaml

    (@mishaml)


    Hi! I’m using your rest api guide to implement login for users via Google, Facebook and Apple. However, Facebook returns not access_token but a jwt, so the code example always throws an error on it. How can I do rest api authentification via facebook, do you have a method to convert jwt to access token, or i can use jwt somehow to login and register users via api.

    • This topic was modified 1 year, 5 months ago by mishaml.
Viewing 1 replies (of 1 total)
  • Plugin Support Laszlo

    (@laszloszalvak)

    Hi @mishaml

    I think there is probably a misunderstanding here. So first of all I need to clarify that, our REST API won’t handle the login or the registration, as our documentation mentions:

    all it does is that, it checks if the social media user associated with the access token is registered on your site or not, and if it is, then it will return the User ID of the WordPress account that is associated with the social media account. The actual registration / login logics still need to be implemented via custom coding. ( In the developer documentation you can find a skeleton code, that serves an example. )

    As for JWT token:

    We don’t support JWT tokens. Nextend Social Login uses the OAuth2 authorization protocol:

    Where basically you have a Web App at the provider. Your visitors can authorize that app when they connect with the selected provider, so the Web App can make requests on behalf of the user, using an access token to get their data over the REST API of the provider.

    In order to be able to make REST API requests, our own REST API endpoint also expects you to submit an access token:

    Without that you won’t be able to use it, I am sorry.

    In our developer documentation you can find examples of access token formats that each provider returns normally:

    Tip:

    There is a third party developer, who created a plugin that utilizes “Nextend Social Login” and the “JWT Authentication for WP REST API” plugin to handle login over the REST API. We are not affiliated the plugin’s developer, but in this topic you can find the link of the plugin:

    Feel free to get in touch with the developer of the plugin, and they could give you more information regarding the JWT tokens.

    Best regards,
    Laszlo.

Viewing 1 replies (of 1 total)

The topic ‘Rest api authentification via Facebook’ is closed to new replies.