auth-request

Nginx auth_request handler accessing POST request body?

左心房为你撑大大i 提交于 2021-02-04 17:29:26
问题 I'm using Nginx (version 1.9.9) as a reverse proxy to my backend server. It needs to perform authentication/authorization based on the contents of the POST requests. And I'm having trouble reading the POST request body in my auth_request handler. Here's what I got. Nginx configuration (relevant part): server { location / { auth_request /auth-proxy; proxy_pass http://backend/; } location = /auth-proxy { internal; proxy_pass http://auth-server/; proxy_pass_request_body on; proxy_no_cache "1"; }

NGiNX auth_request set-cookie for use downstream?

大兔子大兔子 提交于 2020-01-02 07:27:20
问题 Trying to create a cookie inside the auth_request call and pass it downstream for immediate use. The best I can manage so far is setting the cookie in the browser after the call is complete with: auth_request /blah/blah; auth_request_set $saved_set_cookie $upstream_http_set_cookie; add_header Set-Cookie $saved_set_cookie; That cookie will not be available downstream until the next request. I can always get the new cookie by doing the following, but it's not ideal to have it in a new header

Caching Token from auth_request

别来无恙 提交于 2019-12-23 09:56:58
问题 I want to cache the token from my request header field Authorization. Authorization : Bearer abcdefghijklmnopqrstuvwxyz My goal is, that I don't have to validate every request on the validation-server. If the Authorization-Token is cached (and valid), than the request should call the API without validation. location /main { auth_request /auth; proxy_ignore_headers Cache-Control; proxy_pass http://API; proxy_http_version 1.1; } location /auth { internal; proxy_cache my_cache; proxy_ignore

Can't adjust redirect in Nginx, for message with code 401 “Auth Required”

﹥>﹥吖頭↗ 提交于 2019-12-11 06:32:14
问题 I can't adjust redirect in Nginx virtual hosts config-file, specifically for "401 error message" (401 Authorization Required). My target: When I open address in web-browser, for example it'll be my.domain.com, I want adjust basic authentication and I wanna get custom html page with original design and original login form instead of simple browser window. screen shot So, for this realisation need adjust redirect on 401 message to my custom page. I did try it like this, but it doesn't gave to

NGiNX auth_request set-cookie for use downstream?

梦想与她 提交于 2019-12-05 22:23:04
Trying to create a cookie inside the auth_request call and pass it downstream for immediate use. The best I can manage so far is setting the cookie in the browser after the call is complete with: auth_request /blah/blah; auth_request_set $saved_set_cookie $upstream_http_set_cookie; add_header Set-Cookie $saved_set_cookie; That cookie will not be available downstream until the next request. I can always get the new cookie by doing the following, but it's not ideal to have it in a new header name: auth_request_set $saved_cookie_try_2 $upstream_cookie_COOKIE_NAME; proxy_set_header X-Fake-Cookie

Setting headers with NGINX auth_request and oauth2_proxy

£可爱£侵袭症+ 提交于 2019-12-03 04:20:56
问题 I want to use the auth_request and oauth2_proxy to set a header upon a successful authentication request and then pass that through to the next proxy inline that will handle the actual request. I've setup NGINX and the various proxies to do their thing, however I'm unsure how to set the header from the server (AUTH PROXY in diagram) that I'm using for the auth request such that that header is passed to the next server (BACKEND SERVER in diagram) NGINX ---- auth request ----> AUTH PROXY | | <-

Setting headers with NGINX auth_request and oauth2_proxy

时间秒杀一切 提交于 2019-12-02 17:37:34
I want to use the auth_request and oauth2_proxy to set a header upon a successful authentication request and then pass that through to the next proxy inline that will handle the actual request. I've setup NGINX and the various proxies to do their thing, however I'm unsure how to set the header from the server (AUTH PROXY in diagram) that I'm using for the auth request such that that header is passed to the next server (BACKEND SERVER in diagram) NGINX ---- auth request ----> AUTH PROXY | | <--- 201 <------ SUCCESS | ----> underlying request ----> BACKEND SERVER My NGINX config looks like

Nginx authentication with auth_request module

痞子三分冷 提交于 2019-11-29 02:24:53
i have installed nginx with auth_request module enabled, but i have a problem when i am trying to setup the authentication. I want to authenticate through a php script, when a user makes request to this location, then the nginx request to a php file and if the response will be 2xx then authentication true if the response will be 4xx then authentication failed. This is what i made for now and it is working perfect this thing but i dont know how to pass arguments on the php file like username password for example: http://example.com/live/index.php?username=test&password=password Here is the

Nginx authentication with auth_request module

…衆ロ難τιáo~ 提交于 2019-11-27 16:45:54
问题 i have installed nginx with auth_request module enabled, but i have a problem when i am trying to setup the authentication. I want to authenticate through a php script, when a user makes request to this location, then the nginx request to a php file and if the response will be 2xx then authentication true if the response will be 4xx then authentication failed. This is what i made for now and it is working perfect this thing but i dont know how to pass arguments on the php file like username

Can i append some information in oauth/check_token endpoint and retrieve it at authorization server?

走远了吗. 提交于 2019-11-27 04:31:49
问题 Preface I am working on an OAuth application for security between two servers. I have an OAuth Server and a Resource Server . The Resource Server has a single .war deployed that contains 4 APIs . Single Responsibility The OAuth server has to validate a the access token that was passed by an API (1 of the 4) from that same .war . The OAuth server has to keep a hit count for a particular accessToken for a particular API . If the hit count exceeds the configured hits the OAuth server would throw