You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Replace Kubernetes (Helm) tabs with Config file (JSON) tabs on all
three Portal CORS steps
- Link PORTAL_CORS_ENABLE and PORTAL_CORS_ALLOWED_ORIGINS to their
exact anchors in the configuration reference wherever they appear
in prose and warning callouts
- Remove Type column from optional settings table
Copy file name to clipboardExpand all lines: portal/how-to-guides/configure-cors.mdx
+33-25Lines changed: 33 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,31 +20,33 @@ Cross-origin request configuration in the Developer Portal involves two independ
20
20
Portal application CORS controls which external origins may call the Portal's own Admin API and Live Portal routes. It is configured via environment variables on the Portal process.
21
21
22
22
<Warning>
23
-
`PORTAL_CORS_ENABLE` defaults to `false`. All cross-origin requests to the Portal are rejected until you set this to `true`.
23
+
[`PORTAL_CORS_ENABLE`](/product-stack/tyk-enterprise-developer-portal/deploy/configuration#portal-cors-enable) defaults to `false`. All cross-origin requests to the Portal are rejected until you set this to `true`.
24
24
</Warning>
25
25
26
26
1.**Enable CORS**
27
27
28
-
Set `PORTAL_CORS_ENABLE=true` on the Portal process.
28
+
Set [`PORTAL_CORS_ENABLE`](/product-stack/tyk-enterprise-developer-portal/deploy/configuration#portal-cors-enable) to `true` on the Portal process.
29
29
30
30
<Tabs>
31
31
<Tabtitle="Environment variable">
32
32
```ini
33
33
PORTAL_CORS_ENABLE=true
34
34
```
35
35
</Tab>
36
-
<Tabtitle="Kubernetes (Helm)">
37
-
```yaml
38
-
extraEnvs:
39
-
- name: PORTAL_CORS_ENABLE
40
-
value: "true"
36
+
<Tabtitle="Config file">
37
+
```json
38
+
{
39
+
"CORS": {
40
+
"Enable": true
41
+
}
42
+
}
41
43
```
42
44
</Tab>
43
45
</Tabs>
44
46
45
47
2.**Set allowed origins**
46
48
47
-
Set `PORTAL_CORS_ALLOWED_ORIGINS` to the origins permitted to make cross-origin requests to the Portal. Use the exact scheme and host of each origin, separated by commas. Wildcards are supported.
49
+
Set [`PORTAL_CORS_ALLOWED_ORIGINS`](/product-stack/tyk-enterprise-developer-portal/deploy/configuration#portal-cors-allowed-origins) to the origins permitted to make cross-origin requests to the Portal. Use the exact scheme and host of each origin, separated by commas. Wildcards are supported.
48
50
49
51
{/* TODO: Verify the default behavior when PORTAL_CORS_ALLOWED_ORIGINS is unset. Code analysis (rs/cors library) indicates an empty slice allows all origins. The configuration reference states no origins are allowed by default. Confirm with the Portal team before documenting a specific default. */}
50
52
@@ -54,17 +56,22 @@ Portal application CORS controls which external origins may call the Portal's ow
Do not set `PORTAL_CORS_ALLOWED_ORIGINS` to `*` when `PORTAL_CORS_ALLOW_CREDENTIALS=true`. The CORS specification does not allow credentialed requests from wildcard origins. Specify each origin explicitly instead.
74
+
Do not set [`PORTAL_CORS_ALLOWED_ORIGINS`](/product-stack/tyk-enterprise-developer-portal/deploy/configuration#portal-cors-allowed-origins) to `*` when `PORTAL_CORS_ALLOW_CREDENTIALS=true`. The CORS specification does not allow credentialed requests from wildcard origins. Specify each origin explicitly instead.
68
75
</Warning>
69
76
70
77
3.**Set allowed headers and methods**
@@ -78,23 +85,24 @@ Portal application CORS controls which external origins may call the Portal's ow
4.**(Optional) Configure additional CORS settings**
93
101
94
-
| Config key | Type | Default | Description |
95
-
|---|---|---|---|
96
-
| [`CORS.MaxAge`](/product-stack/tyk-enterprise-developer-portal/deploy/configuration#portal-cors-max-age) | `int` | `0` | How long, in seconds, browsers may cache the preflight response. A positive value reduces preflight round trips. |
97
-
| [`CORS.AllowCredentials`](/product-stack/tyk-enterprise-developer-portal/deploy/configuration#portal-cors-allow-credentials) | `bool` | `false` | Whether the Portal includes credentials (cookies, HTTP authentication) in CORS responses. |
102
+
| Config key | Default | Description |
103
+
|---|---|---|
104
+
|[`CORS.MaxAge`](/product-stack/tyk-enterprise-developer-portal/deploy/configuration#portal-cors-max-age)|`0`| How long, in seconds, browsers may cache the preflight response. A positive value reduces preflight round trips. |
105
+
|[`CORS.AllowCredentials`](/product-stack/tyk-enterprise-developer-portal/deploy/configuration#portal-cors-allow-credentials)|`false`| Whether the Portal includes credentials (cookies, HTTP authentication) in CORS responses. |
0 commit comments