'Passing a jwt from a non-vue.js portal to a vue.js application

I'm trying to figure out the best (and possibly secure) way to pass a jwt from a web application to another (vue-based). The first web application is a portal where an user authenticates itself (with a backend that produces a jwt) and then (with an hyperlink) is redirected to a vue.js application that needs the same jwt to interact with its backend.

Schema

The two backends share a private key used to sign and validate the jwt, so that with the same jwt produced by the portal backend the vue app can access private data on its own backend.

I've tried using query parameters when redirecting to the vue.js app, but i don't like this solution and i was wondering if there's something better i can do.

Notes: The portal frontend is written with a proprietary code generator that can't (probably) execute javascript code to use sessionStorage or localStorage. The portal backend is written with the same generator but could be extended using C# (don't think this is relevant).

The vue frontend is a SPA that uses Vue-Router and Pinia as storage, while the vue backend is written in Java using Quarkus (this shouldn't be relevant too).



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source