• Resolved Anonymous User 18394345

    (@anonymized-18394345)


    Hello, I’m using wordpress as headless cms, therefore I need to authenticate users with ajax requests.
    What I have is provider access token and user id (as you say in the docs). Can I log in user with only these informations? Does your plugin expose some php function maybe, that I could use to create custom rest endpoint to authenticate them?
    This is how I think it should look like:
    -after google (for example) authentication (which I need to code manually on frontend) I receive access token
    -im passing this access token to your plugin rest api endpoint to check if user exists
    -if user exists im sending request to another endpoint (which I need to create manually), where I’m using your php function to authenticate user with access token and user id.
    The problem is, I can’t find any information in your docs on how to log in user with php (having access token and user id). I’m sure you have some function that sets current user with access token… Could you help me with that?

Viewing 1 replies (of 1 total)
  • Plugin Support Laszlo

    (@laszloszalvak)

    Hi there

    The only thing that our REST API can help you with is checking whether there is a user with the given access token or not. Any if there is we give you the user ID.
    So everything else needs to be implemented with custom coding ( e.g. in a custom plugin ) that we can not provide support for.

    But actually you can find multiple tutorials on the internet that shows how you can handle the registering and login in WordPress using its own functions, e.g.:

    Or you can also check our source code in this file:

    • wp-content/plugins/nextend-facebook-connect/includes/user.php

    For the login related part, check the login() method.

    But as I mentioned above, please note that, we can not provide support for any kind of custom coding!

    Best regards,
    Laszlo.

    • This reply was modified 2 years, 6 months ago by jordesign. Reason: Editing to remove deleted user's username on request
Viewing 1 replies (of 1 total)

The topic ‘Manual login with php’ is closed to new replies.