Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

259
Vistas
Nginx Ingress pass whole url to oauth proxy as Redirect

I am running a Kubernetes Cluster with an Nginx-ingress fronting couple of web apps. Because Nginx doesn't support SSO/OIDC by default, I use an oauth_proxy for authentication.

In detail I use oauth2_proxy (https://github.com/pusher/oauth2_proxy) with Azure AD.

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: nginx-ingress-internal
  namespace: ingress-nginx
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /$2
    nginx.ingress.kubernetes.io/auth-url: "https://example.com/oauth2/auth"
    nginx.ingress.kubernetes.io/auth-signin: "https://example.com/oauth2/start?rd=$escaped_request_uri"
    nginx.ingress.kubernetes.io/auth-response-headers: "authorization, x-auth-request-user, x-auth-request-email, x_auth_request_access_token"

spec:
  rules:
  - host: example.com
    http:
      paths:
      - path: /home(/|$)(.*)
        backend:
          serviceName: app-homepage-frontend-service
          servicePort: 80
      - path: /homepage-backend(/|$)(.*)
        backend:
          serviceName: app-homepage-backend-service
          servicePort: 80

I skiped some details like tls. So in general everything is working, only verified users are able to access the web pages.

The issue is that my frontend is writte in Angular which use hash-routing. And if try to enter a deep route like

https://example.com/home/#/page1/subpage2

just base path (/home) is passed as redirect url. So when I'm authorized successfully, I get redirected to https://example.com/home.

Is there any veriable instead of $escaped_request_uri, which pass the whole url?

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Please try with below process might be it will help!!

  • Adding State Parameter will help for oauth2_proxy

State Parameter

State parameter will reserve the state prior to authentication request and pass random generated state value in request to authenticate and in call back request they will add state back i.e. Oauth2_Proxy generated id. Then Oauth2_Proxy will read that ID and provide the URL back and respond.

Use below link

https://dev.bitly.com/v4_documentation.html

Bitly Oauth2_Proxy added the same in there code.

https://github.com/bitly/oauth2_proxy/blob/master/providers/provider_default.go#L87-L89

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda