-
Notifications
You must be signed in to change notification settings - Fork 359
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upstream not being redirected correctly after oathkeeper approval #631
Comments
I don't know if that is a copy/paste error, but in your curl command you are using |
The reason I call with https is because my ingress controller enforces https and is doing ssl termination. I also tried if I can match the access rule on https, but it seems oathkeeper only passes through http.
Someone mentioned he used only http in a similar case: (and somehow got it working that way) |
Right. I am a bit confused from the first logs you posted. There are actually two requests from ambassador, one going to |
That is exactly the case! I am also confused where 2 requests are coming from and why would oathkeeper want to match the url, as it is only configured as an upstream in the access rule. |
I assume there is a problem with ambassador or the routing in general, that causes these issues. The request is coming from ambassador and therefore I recommend you have a look there. Is Oathkeeper able to reach |
Thanks @zepatrik that was the hint I needed (that it probably isn't the oathkeeper config) now I've made it work! The issue was with the upstream in the rule. I was pointing it to the ambassador URL of the upstream service, so after the first rule succeeded, it returned to ambassador and triggered another round of authentication with the upstream service, which of course failed. All I needed to do, was to point my upstream directly to the service and not the URL under which it was served under ambassador. I also had to patch my auth service slightly, because I needed to pass JSON data to the upstream service after authentication
|
Awesome, glad you figured it out. |
Describe the bug
I am running an internal service on kubernetes, behind an Ambassador API gateway, itself behind a Traefik ingress controller.
The service endpoint has an associated AuthService, connected to an Oathkeeper instance. The access rule to the service is created with a CRD by Oathkeeper-maester and uses the Oauth2 introspection workflow.
The oathkeeper token authentication seems to succeed, as I see the request going to oathkeeper and back to the api gateway. This happens when I correctly issue an active token with a proper header
However for some reason the redirect to the upstream URL seems not to work and I get a 404 with a message that the Request URL does not match any rules (why should an upstream match the access rule url?) and in the one before last line it seems the same request is granted, but still returns a 404. Why could this be happening? My configurations are pasted below
I invoke the request with curl like so:
>>> curl -k -X POST -H "Special-Authorization: <token>" https://<service>/my/service/url
Environment
Oathkeeper Logs
192.168.235.133 is the traefik ingress controller
192.168.235.134 is the ambassador API gateway
192.168.235.149 is the oathkeeper proxy
Authservice:
Access rule
The text was updated successfully, but these errors were encountered: