Access-Control-Allow-Origin header missing from Portal responses
Access-Control-Allow-Origin header missing from Portal responses
SymptomRequests from your application to the Portal Admin API or Live Portal routes fail. The browser console shows:Preflight
OPTIONS requests to the Portal return 404 Not Found or 405 Method Not Allowed.CausePORTAL_CORS_ENABLE is false (the default). The Portal’s CORS middleware is disabled, so no Access-Control-Allow-Origin header is added to any response and OPTIONS preflight requests fall through to the router with no matching handler.FixEnable Portal CORS and set your allowed origins. See Configure Portal Application CORS.API Playground requests fail with 401 Unauthorized or missing CORS headers
API Playground requests fail with 401 Unauthorized or missing CORS headers
403 Forbidden on OPTIONS preflight in Gateway v5.8.6–v5.8.13
403 Forbidden on OPTIONS preflight in Gateway v5.8.6–v5.8.13
SymptomAPI Playground requests fail on Gateway versions v5.8.6 through v5.8.13, even when CORS is correctly configured and the Portal origin is in The CauseA middleware ordering regression in Gateway versions v5.8.6–v5.8.13 caused the allow-list middleware (
allowed_origins. The browser console shows:OPTIONS preflight returns 403 Forbidden with one of the following response bodies:VersionCheck) to run before the CORS middleware. The allow-list evaluates the OPTIONS method against endpoint rules and returns 403 Forbidden before the CORS middleware can intercept and handle the preflight.FixUpgrade Tyk Gateway to v5.8.14 or later, where the middleware ordering is corrected.CORS error: wildcard origin rejected when credentials are enabled
CORS error: wildcard origin rejected when credentials are enabled
SymptomCredentialed cross-origin requests to the Portal fail. The browser console shows:CausePORTAL_CORS_ALLOW_CREDENTIALS=true is set alongside an unset or wildcard PORTAL_CORS_ALLOWED_ORIGINS. When See Configure Portal Application CORS.
PORTAL_CORS_ALLOWED_ORIGINS is unset or set to *, the Portal responds with Access-Control-Allow-Origin: *. The CORS specification forbids combining a wildcard origin with Access-Control-Allow-Credentials: true, so the browser rejects the response.FixSet PORTAL_CORS_ALLOWED_ORIGINS to specific origins or to http://*,https://* to allow all. Both prevent the wildcard * response that browsers block when credentials are in use:Related
- Configure CORS — set up Portal application CORS and Gateway API CORS
- Portal configuration reference — full list of Portal environment variables