Skip to content
This repository was archived by the owner on Aug 7, 2025. It is now read-only.

Commit 5b446bc

Browse files
Pinpoint: OTP operations
1 parent d92e732 commit 5b446bc

File tree

1 file changed

+46
-0
lines changed
  • content/en/user-guide/aws/pinpoint

1 file changed

+46
-0
lines changed

content/en/user-guide/aws/pinpoint/index.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,49 @@ The following output would be retrieved:
9393
}
9494
}
9595
```
96+
97+
### OTP verification
98+
99+
The operations `SentOTPMessage` and `VerifyOTPMessage` are used for one-time password (OTP) verification.
100+
101+
{{< command >}}
102+
$ awslocal pinpoint send-otp-message \
103+
--application-id 4ba98561ebb2cd48c \
104+
--send-otp-message-request-parameters '{
105+
"BrandName": "LocalStack Community",
106+
"Channel": "SMS",
107+
"DestinationIdentity": "+1224364860",
108+
"ReferenceId": "meetup2024",
109+
"OriginationIdentity": "+1123581321",
110+
"CodeLength": 6,
111+
"AllowedAttempts": 3,
112+
"ValidityPeriod": 2
113+
}'
114+
{{< /command >}}
115+
116+
On production, AWS sends an actual SMS text message with the OTP to the destination
117+
The OTP can then be verified against the reference ID using `VerifyOTPMessage`:
118+
119+
{{< command >}}
120+
$ awslocal pinpoint verify-otp-message \
121+
--application-id 4ba98561ebb2cd48c \
122+
--verify-otp-message-request-parameters '{
123+
"ReferenceId": "meetup2024",
124+
"DestinationIdentity": "+1224364860",
125+
"Otp": "666666"
126+
}'
127+
{{< /command >}}
128+
129+
LocalStack can not send an actual SMS text with the OTP.
130+
However you can use the debug endpoint `/_aws/pinpoint/<application_id>/<reference_id>` to retrieve the OTP message details:
131+
132+
{{< command >}}
133+
$ curl http://127.0.0.1:4566/_aws/pinpoint/4ba98561ebb2cd48c/meetup2024 | jq .Code
134+
"666666"
135+
{{< /command >}}
136+
137+
The OTP is also printed as an `INFO` level log message:
138+
139+
```text
140+
141+
```

0 commit comments

Comments
 (0)