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

will oauth2_proxy support PUT #647

Open
mchiao opened this issue Sep 5, 2018 · 2 comments
Open

will oauth2_proxy support PUT #647

mchiao opened this issue Sep 5, 2018 · 2 comments

Comments

@mchiao
Copy link

mchiao commented Sep 5, 2018

I got oath2_proxy working with openresty/nginx.

However, I have noticed an issue or not...
Lets say I made a PUT request to my nginx, request hands to oauth2_proxy for authentication/authorization.
When oauth2_proxy finishes (validating access token, refresh token, etc...), it redirect back to nginx but now with a 'GET' instead of 'PUT'.

Is this normal? a feature?

Thanks

@ploxiln
Copy link
Contributor

ploxiln commented Sep 5, 2018

The first request from browser which is not already "logged-in" to oauth2_proxy will go through the oauth2 flow and end up with a redirect back to the original destination, with method changed to GET (and no body, of course).

Subsequent requests will carry the cookie which oauth2_proxy will recognize, and the PUT will go through to the backend service unchanged.

If you're using the nginx auth_request directive, it's a bit more complicated: the auth request to oauth2_proxy will not include the body, but will have the original Content-Length header, which will confuse oauth2_proxy into waiting for a body which will not come. The README has the nginx config options to correct for this.

@mchiao
Copy link
Author

mchiao commented Sep 5, 2018

Yes, auth_request is being used...

Are you referring to these lines?

proxy_set_header Content-Length   "";
proxy_pass_request_body           off;

Regards,

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