Skip to content

Commit 1260713

Browse files
hperlvinckr
authored andcommitted
feat: document SMS ctx.request_headers
1 parent 8be711e commit 1260713

File tree

2 files changed

+41
-14
lines changed

2 files changed

+41
-14
lines changed

docs/guides/integrate-with-ory-cloud-through-webhooks.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,12 @@ Sec-Fetch-Site
111111
Sec-Fetch-User
112112
True-Client-Ip
113113
User-Agent
114+
X-Forwarded-Host
115+
Ory-Base-Url-Rewrite
116+
Ory-Base-Url-Rewrite-Token
117+
X-Ory-Original-Host
118+
Ory-No-Custom-Domain-Redirect
119+
Cf-Ipcountry
114120
```
115121

116122
To customize allowed headers, use the `actions.web_hook.header_allowlist` configuration option.

docs/kratos/emails-sms/10_sending-sms.mdx

Lines changed: 35 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ configure SMS:
6969
ory update identity-config --project <project-id> --workspace <workspace-id> --file updated_config.yaml
7070
```
7171

72+
```mdx-code-block
73+
</TabItem>
74+
</Tabs>
75+
```
76+
7277
### Body configuration
7378

7479
The body of the above snippet decodes to the following Jsonnet template:
@@ -87,23 +92,44 @@ Fields available on the `ctx` object are:
8792
- `template_type`: The template type, e.g. `verification_code`
8893
- `template_data`: The template data, e.g. `{ "VerificationCode": "1234", Idenity: { ... } }`
8994
- `message_type`: The message type, e.g. `sms`
95+
- `request_headers`: A map of all HTTP request headers forwarded from the user request (see below)
9096

91-
Read the [Jsonnet documentation](../../kratos/reference/jsonnet.mdx) to learn more about the Jsonnet templating language.
97+
#### Accessing request headers
9298

93-
```mdx-code-block
94-
</TabItem>
95-
</Tabs>
99+
The following request headers are available via `ctx.request_headers`:
100+
101+
```
102+
Accept
103+
Accept-Encoding
104+
Accept-Language
105+
Content-Length
106+
Content-Type
107+
Origin
108+
Priority
109+
Referer
110+
Sec-Ch-Ua
111+
Sec-Ch-Ua-Mobile
112+
Sec-Ch-Ua-Platform
113+
Sec-Fetch-Dest
114+
Sec-Fetch-Mode
115+
Sec-Fetch-Site
116+
Sec-Fetch-User
117+
True-Client-Ip
118+
User-Agent
119+
X-Forwarded-Host
120+
Ory-Base-Url-Rewrite
121+
Ory-Base-Url-Rewrite-Token
122+
X-Ory-Original-Host
123+
Ory-No-Custom-Domain-Redirect
124+
Cf-Ipcountry
96125
```
97126

127+
Read the [Jsonnet documentation](../../kratos/reference/jsonnet.mdx) to learn more about the Jsonnet templating language.
128+
98129
## Templates
99130

100131
Only the `recovery_code`, `verification_code`, and `login_code` templates support an SMS variant. Use the CLI to configure it:
101132

102-
```mdx-code-block
103-
<Tabs groupId="console-or-cli">
104-
<TabItem value="cli" label="Ory CLI">
105-
```
106-
107133
1. Download the Ory Identities config from your project and save it to a file:
108134

109135
```shell
@@ -145,8 +171,3 @@ Only the `recovery_code`, `verification_code`, and `login_code` templates suppor
145171
```shell
146172
ory update identity-config --project <project-id> --workspace <workspace-id> --file updated_config.yaml
147173
```
148-
149-
```mdx-code-block
150-
</TabItem>
151-
</Tabs>
152-
```

0 commit comments

Comments
 (0)