oauth_proxy in front of kubernetes ingress showing error 403

7/25/2019

I am trying to secure my application exposed as LB using oauth2_proxy, I have created 2 ingress resources as required one for running the oauth2_proxy and another for accessing my application which is to be secured through authentication. Refer link [https://github.com/kubernetes/ingress-nginx/tree/master/docs/examples/auth/oauth-external-auth]. I have followed the exact process as mentioned in this link.

When I hit my FQDN or Domain Name in browser it asks for authentication and upon successful authentication I get error

2019/07/25 14:09:56 oauthproxy.go:830: 10.244.2.76:36094 ("10.240.0.5") Cookie "_oauth2_proxy" not present
2019/07/25 14:09:57 oauthproxy.go:788: 10.244.2.76:36088 ("10.240.0.5") Permission Denied: "" is unauthorized
2019/07/25 14:09:57 oauthproxy.go:532: ErrorPage 403 Permission Denied Invalid Account

I expect to successfully redirected to my application service as authentication is successful. How can I achieve this?

-- Nitesh Ratnaparkhe
kubernetes-ingress
oauth
oauth-2.0
proxy
reverse-proxy

1 Answer

7/26/2019

It seems from the log that you are able to use the github application for authentication, but the error that "_oauth2_proxy" is not present usually occurs when the application type is not an "oauth" proxy.

Please check if the application that you have created is an oauth application or not just to be sure.

-- idhruv
Source: StackOverflow