-
-
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
Internal call from oathkeeper to hydra introspect url timeout #249
Comments
From the source file authenticator_oauth2_introspection.go i dont see the there is any header added while try to call the introspection_url (X-Forwarded-Proto: https), is it one of the reason? line 84 of authenticator_oauth2_introspection.go
|
Thank you for this very detailed bug report! I think indeed that this could be caused by the missing forward header. Are you calling hydra directly, or through a proxy? |
@aeneasr and since i setup the introspection_url in oathkeeper with internal service endpoint (e.g http://hydra-admin.uat:4445/oauth2/introspect) i assume oathkeeper will check my token by using http.Client.post http://hydra-admin.uat:4445/oauth2/introspect and i resulted an timeout error, but if i change introspection_url to public endpoint of hydra, it work fine in the last hour, i create a golang application by using net/http to call the internal service endpoint and deploy to my kubenetes, it work too so i believe it is not related to forward header or something here is my simple code
and here is the docker file for you to build this code
|
Any Idea? |
i just double check the log from Hydra, turnout it is the timeout message from oathkeeper confuse me it really like what you said, it missing the header Forwarded-Proto, but im not sure how to make it work? as i already set the hydra "tls.allow_termination_from" to
so 0.0.0.0/0 wouldnt work at all?
|
We simply need to add the ability to set |
please also make it on pre_authentication too |
I am closing this issue as it has not received any engagement from the community or maintainers in a long time. That does not imply that the issue has no merit. If you feel strongly about this issue
We are cleaning up issues every now and then, primarily to keep the 4000+ issues in our backlog in check and to prevent maintainer burnout. Burnout in open source maintainership is a widespread and serious issue. It can lead to severe personal and health issues as well as enabling catastrophic attack vectors. Thank you to anyone who participated in the issue! 🙏✌️ |
Describe the bug
we deploy the oathkeeper as api gateway and hydra as oauth into kubernetes ENV,
we use oauth2_introspection as the authenticators
then we setup the introspection_url to internal URL of kubernetes
(e.g http://hydra-admin.uat:4445/oauth2/introspect
we tested inside the pod of oathkeeper, and it is able to ping or curl to http://hydra-admin.uat:4445/oauth2/introspect (yes, we knew that it is require to add header X-Forwarded-Proto: https)
we setup the access rules for a single api to use the authenticators handler oauth2_introspection
and we also setup the TLS Termination of hydra to allow it from 0.0.0.0/0 (anywhere)
while we call the api gateway from public network and it said timeout becoz of http://hydra-admin.uat:4445/oauth2/introspect
we change to the introspection_url to the public url of the hydra admin, and it success without timeout
Expected: internal URL can be used in introspection_url
Actual: internal URL cant be used in introspection_url
Reproducing the bug
Steps to reproduce the behavior:
curl https://apigateway.uat.mydomain.com/mono-service/myapipath -H 'Authorization: bearer 47TCCYLjK1tCGRyrqVW3tnVNkm_QglJ7h2dpZD-3-0s.09wj-tAwqnhKsBSzxCHF7cp18ebKRyW0aVlBuxCSIy0'
{ "error": { "code": 500, "request": "0d145068519d20b64082fac0292bc2b0", "message": "Post http://hydra-admin.uat:4445/oauth2/introspect: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)" } }
Server logs
Expected behavior
Expected: internal URL can be used in introspection_url
Environment
kubernetes :
Server Version: version.Info {Major:"1", Minor:"9", GitVersion:"v1.9.3", GitCommit:"d2835416544f298c919e2ead3be3d0864b52323b", GitTreeState:"clean", BuildDate:"2018-02-07T11:55:20Z", GoVersion:"go1.9.2", Compiler:"gc", Platform:"linux/amd64"}
Ingress controller:
quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.24.1
oathkeeper
oryd/oathkeeper:v0.17.0-beta.1
hydra
oryd/hydra:v1.0.0
The text was updated successfully, but these errors were encountered: