Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    I’m not aware of WP using JWTs for anything, however, REST output can be filtered, so you could somehow convert the normal REST JSON response to a JWT. I don’t think JWT is really necessary for most situations, especially if HTTPS is being used. But if you wish to implement JWT anyway, I’m not objecting 🙂

    I’m not sure you need any extra cookies either. WP REST requires the user to be logged in conventionally (setting an auth cookie), though there are other authentication methods available. Thus REST responses are going to be related to the logged in user anyway, without any special effort on your part. If the current user cannot create posts, there is nothing you can request through REST that would create a post.

    Does your app even really need to know the current username? Any data returned from REST can be for the current user only, provided that user has the proper capabilities. You can have REST provide the current username all right, I’m just not convinced it’s really needed. All user authentication can be managed by WP alone.

    Maybe I’m missing something, but it sounds like you are over complicating things.

Viewing 1 replies (of 1 total)

The topic ‘Re-using WP login for external REST services’ is closed to new replies.