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

Add /auth endpoint to support Nginx's auth_request #153

Merged
merged 3 commits into from
Nov 9, 2015

Conversation

mbland
Copy link
Contributor

@mbland mbland commented Oct 8, 2015

Closes #152.

@mbland
Copy link
Contributor Author

mbland commented Oct 8, 2015

Thinking about it, I realized that auth_request can actually pass cookies back through when configured with auth_request_set. Just pushed a commit that does more what I first imagined, where the bulk of Proxy() has become Authenticate(), which is shared between a thin new Proxy() and AuthenticateOnly(). Tests didn't need to change.

So if a user is logged in, this new commit will allow the cookie to be refreshed and other auth headers to be returned, but the redirect won't happen if the cookie isn't set or if it's expired. In the previous version, all that's returned is 202 or 403.

@jehiah
Copy link
Member

jehiah commented Nov 9, 2015

@mbland I landed some renaming in #164 which conflicts with this. Can you rebase to resolve that, and add some docs for configuring with nginx auth_request module.

@mbland
Copy link
Contributor Author

mbland commented Nov 9, 2015

@jehiah Done!

@jehiah
Copy link
Member

jehiah commented Nov 9, 2015

🎉 🍰 🍴

jehiah added a commit that referenced this pull request Nov 9, 2015
Add /auth endpoint to support Nginx's auth_request
@jehiah jehiah merged commit 7c241ec into bitly:master Nov 9, 2015
@mbland mbland deleted the auth-only-endpoint branch November 9, 2015 16:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

Successfully merging this pull request may close these issues.

2 participants