Questions tagged [auth-request]

53 questions
25
votes
1 answer

Setting headers with NGINX auth_request and oauth2_proxy

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…
mjallday
  • 9,796
  • 9
  • 51
  • 71
15
votes
1 answer

Nginx auth_request handler accessing POST request body?

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.…
yty
  • 515
  • 3
  • 11
9
votes
3 answers

Conditional nginx auth_request

I want to have my nginx proxy perform a subrequest for authentication only if the client is not already authenticated. The conditional part is where I am stuck. How can I craft a configuration so that the client is only authenticated once per…
Baywatch
  • 423
  • 5
  • 17
7
votes
1 answer

Nginx authentication with auth_request module

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…
user3393046
  • 163
  • 1
  • 7
  • 15
6
votes
1 answer

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

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…
6
votes
1 answer

Pass arguments to auth_request module from nginx

I want to protext a live HLS stream. I want to use the auth_request module. I want to check if a request is valid by passing a key. So something like: http://domain.com/hls/stream.m3u8?key=xxxxxxx I have the following setup in nginx.conf: location…
rsdrsd
  • 307
  • 1
  • 4
  • 13
5
votes
2 answers

How do you send an auth_request to a variable URI in nginx?

I am trying to use the auth_request module to check whether a user is allowed to access a certain file. The user posts the request at /my/download/uri/. I want the authorisation request to be posted at auth_service:9999/files/. The…
Wichilie
  • 117
  • 1
  • 8
5
votes
1 answer

Can I create a "private" location in Nginx?

Can I create a location which can be accessed by any other location in nginx config and cannot be accessed directly from outside? I can use a deny directive, but it will also deny access to the locations defined in nginx config. Here's my config -…
Mahesh H Viraktamath
  • 818
  • 3
  • 14
  • 34
5
votes
1 answer

nginx ingress annotations to redirect to authentication and get back headers

I've the below nginx conf file to redirect all the requests (by default) to /auth (of my service) and then get back a response header (foo_id). This header will be forwarded to the original request URI triggered by user. The below works properly…
user9857921
  • 51
  • 1
  • 2
5
votes
2 answers

Caching Token from auth_request

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…
Max L
  • 53
  • 1
  • 5
5
votes
2 answers

nginx auth_request redirect

I use auth_request module(http://nginx.org/en/docs/http/ngx_http_auth_request_module.html). My nginx config: auth_request /auth; auth_request_set $backend_status $upstream_status; location / { proxy_pass http://unicorn; error_page 401…
edenisn
  • 157
  • 1
  • 12
4
votes
1 answer

Keycloak and Nginx: auth_request

I am trying to setup auth_request with keycloak proxy, but it does not work (Nginx returns 500 status code). Here is my example: nginx.conf upstream target_host { server prometheus:9090; } upstream oauth_host { server…
MUHAHA
  • 1,597
  • 2
  • 16
  • 25
4
votes
0 answers

NGiNX auth_request set-cookie for use downstream?

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…
Mike Emery
  • 807
  • 1
  • 11
  • 23
4
votes
1 answer

nginx auth_request error auth request unexpected status: 302 while sending to client

I'm really new to nginx and am having some trouble with auth_request. With the following conf server { listen 80; listen [::]:80; root /var/www/html; index index.php; server_name www.test.com; error_page 401 403 =…
MajorCaiger
  • 1,893
  • 1
  • 12
  • 18
4
votes
0 answers

How to authorize access to directory using nginx auth_request module + python

I want to authorize access to directory /private using auth_request Nginx module . In Nginx documentation , it seems I should do like bellow : server { listen 80; server_name localhost; location /private/{ …
1
2 3 4