I use nginx
external authentication and have a problem when a request is a websocket request. As a webscoket request hasn't headers it passes jwt token in query string parameter access_token
. Nginx goes to an external authenticator that returns Authorization header in a response with a new token (Bearer ...
). I need to replace access_token
of the original request with the token from Authotization
header.
I've tried to at least append it with a new query parameter but it doesn't work (let alone I need to cut off the Bearer
prefix):
auth_request_set $bearer $upstream_http_authorization;
set $args $args&token=$bearer;
Could anyone help me?
I've configured ngnix this way:
auth_request_set $bearer $upstream_http_authorization;
set $args $args&token=$bearer;
I expect it append to query string a new parameter token
with a value from Authorization
header of a authorization subrequest.