Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

262
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda