I am able to take the token from URL but after that, I want to return it at the and of the next one. For example, I have URL like this:
http://localhost:8900/dashboards?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
I want to take the token and add it at the end of the next request. For example:
http://localhost:8900/home?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
And so on...
I am stuck at this for a while and I will appreciate any help. Thank you in advance!
Here is my code so far:
location / {
set $token $arg_token;
add_header 'Access-Control-Allow-Credentials' 'true' always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS' always;
proxy_set_header X-WEBAUTH-USER $remote_user;
proxy_set_header X-User-custom $token;
proxy_pass http://localhost:3000;
}