0
I have three applications:
1. Login (which runs on door 8080) with jQuery very simple
2. API (wheel at port 4000) with Nodejs
3. Web (rotating at port 4200) with Angular
When I am logged in and click on "Log in", will call the API, validate if the user exists, if success will return a JWT token. When you return this token, I need to set it to localStorage, then redirect it to the web application.
The problem with this is that they are different ports, if I set in the login application’s localStorage and then redirect to the web application, the token will no longer exist in the localStorage.
How can I solve this problem?
And then Lauro. I didn’t like the idea of using <iframe> to synchronize the data. Do you really think it’s good practice? I’ll take a look at this library you commented on.
– Guilherme Nass
No, it can be difficult to maintain, debug and if you need a more restrictive CSP becomes difficult... you will have to create rules for which pages to use or not a
<iframe>
is viable bad, I think if you just want the token will be easier to use cookie even– Lauro Moraes
I came to use a long time ago something I found and modified...if I find in my documents sending to a Gist Github and add an Aki link... may have some utility within the scope of the question but I do not recommend to carry an access token
– Lauro Moraes