Integrating Vue.js Web Component with JWT Authentication into WordPress: Generating JWT Tokens from Cookies?

Hello everyone. I need to integrate a small Vue.js app, built as a web component, which communicates with a REST API authenticated using JWT, into a WordPress page.

My goal is to generate JWT tokens using a JWT plugin for WP-API and configure the API to accept these tokens (external authority).
However, the current parent app is using basic authentication via cookies, and I don’t want to store the JWT token or ask the user for their password again.
So, I need to figure out how to generate a JWT token from the cookie, which will function very similarly to a refresh\_token.

Has anyone encountered a similar requirement? If yes, what did you do to fulfill it?


This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer