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

415
Vistas
Istio Request Authentication - getting Cors with result 404

This is my requestauthentication,

apiVersion: security.istio.io/v1beta1
kind: RequestAuthentication
metadata:
  name:prod-authenticator
  namespace: prod
spec:
  selector:
    matchLabels:
      istio: ingressgateway
  jwtRules:
  - issuer: https://securetoken.google.com/<project-id>
    jwksUri: https://www.googleapis.com/service_accounts/v1/jwk/securetoken@system.gserviceaccount.com

My AuthorizationPolicy is this,

apiVersion: security.istio.io/v1beta1
kind: AuthorizationPolicy
metadata:
 name:prod-authorized-api
 namespace: prod
spec:
 action: ALLOW
 rules:
 - from:
   - source:
        requestPrincipals: ["*"]

 - to:
    - operation:
        paths: ["/user/ping"]

The below helps me to exlcude the health path (/user/ping) without valid token.

My Virtual Service is

apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: user-svc-vs
  namespace: prod
spec:
  hosts:
  - gateway.xxxx.com
  gateways:
  - istio-system/prod-gateway
  http:
  - match:
    - uri:
        prefix: /pop
    route:
    - destination:
        host:user-svc.prod.svc.cluster.local 

But when checked i can see that only health api gets 200 rest all are getting 404, when checked the browser i saw that

Access to XMLHttpRequest at 'https://' from origin 'https://<>' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

In the virtual service i tried to add "corsPolicy" but nothing worked.

sample virutal service tried example is

apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: ratings-route
spec:
  hosts:
  - ratings.prod.svc.cluster.local
  http:
  - route:
    - destination:
        host: ratings.prod.svc.cluster.local
        subset: v1
    corsPolicy:
      allowOrigins:
      - exact: https://example.com
      allowMethods:
      - POST
      - GET
      allowCredentials: false
      allowHeaders:
      - X-Foo-Bar
      maxAge: "24h"

<<the above is not our example but i have copied but i applied with my current env but still no Luck! can any one help, struggling for the whole day on this :)

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

0

CORS pre-flight requests are HTTP OPTIONS requests which are issued by browsers automatically, see this site for details.

Therefore, allow OPTIONS calls in your AuthorizationPolicy to allow pre-flight requests.

- to:
    - operation:
        methods: ["OPTIONS"]
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