Skip to content
This repository has been archived by the owner on Jan 24, 2019. It is now read-only.

An /auth endpoint to support Nginx's auth_request #152

Closed
mbland opened this issue Oct 8, 2015 · 2 comments
Closed

An /auth endpoint to support Nginx's auth_request #152

mbland opened this issue Oct 8, 2015 · 2 comments

Comments

@mbland
Copy link
Contributor

mbland commented Oct 8, 2015

I recently discovered the Nginx auth_request directive, which allows a setup like this:

server {
  listen 443 ssl spdy;
  server_name  myservice.com;

  include ssl/star.myservice.com.conf;

  location = /auth {
    internal;
    proxy_pass http://127.0.0.1:8080;
    proxy_set_header X-Original-URI $request_uri;
  }

  location / {
    auth_request /auth;
    ...
  }
}

Would you be open to having me add an /auth endpoint or similar to the oauth2_proxy?

It'd basically involve splitting the authentication logic from func (p *OauthProxy) Proxy(rw http.ResponseWriter, req *http.Request) into a new AuthenticateRequest() function, adding a thin AuthenticateOnly() handler, and registering that with func (p *OauthProxy) ServeHTTP(rw http.ResponseWriter, req *http.Request) (and adding the requisite options, of course).

mbland pushed a commit to cloud-gov/oauth2_proxy that referenced this issue Oct 8, 2015
@mbland
Copy link
Contributor Author

mbland commented Oct 8, 2015

Per #153, the implementation turned out to be even less complicated than I expected. Got to reuse the test fixture from the existing ProcessCookieTests as well.

@ishamfazal
Copy link

hey this comment isn't relevant for this issue, i'm running into a problem so would need some help to check if its on my code side or not i have created a new provider and trying to authorize so once the once the authorization code is sent back to call back url i get an error check the image
screen shot 2015-10-12 at 5 43 22 pm

mbland pushed a commit to cloud-gov/oauth2_proxy that referenced this issue Nov 9, 2015
stepanstipl pushed a commit to stepanstipl/oauth2_proxy that referenced this issue Jan 16, 2016
eelcocramer added a commit to servicelab/oauth2_proxy that referenced this issue Jan 20, 2016
Updates readme and help

Adds azure to the providers.

Fixes race condition

Sometimes, during tests, a race condition occurs. Using `break` instead
of `return` fixes this for me.

Tries to read mail address

Tries to read mail address from the Graph API. Currently this
has not been tested properly.

Adds resource parameter

Uses to gain access to protected resources when redeeming the token.

Gets the mail address from the graph

*: rename Url to URL everywhere

Go coding style says that acronyms should be all lower or all upper. Fix
Url to URL.

oauthproxy: rename Uri to URI

Be consistent with Go coding style for acroynyms.

*: rename Oauth to OAuth

Be consistent with Go capitalization styling and use a single way of
spelling this across the tree.

Add /auth endpoint to support Nginx's auth_request

Closes bitly#152.

Extract Authenticate for Proxy, AuthenticateOnly

Add nginx auth_request config to README

Sign Upstream requests with HMAC. closes bitly#147

Renames var ending on Url to URL

Simplifies configuration for brevity
ruta-goomba pushed a commit to ruta-goomba/oauth2_proxy that referenced this issue Jan 21, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants