GO-V.ORG
As seen in

Permissions-Policy: otp-credentials directive

The HTTP Permissions-Policy header otp-credentials directive controls whether the current document is allowed to use the WebOTP API to request a one-time password (OTP) from a specially-formatted SMS message sent by the app's server, i.e., via navigator.credentials.get({otp: ..., ...}).

The HTTP Permissions-Policy header `otp-credentials` directive controls whether the current document is allowed to use the [WebOTP API](/docs/Web/API/WebOTP_API) to request a one-time password (OTP) from a specially-formatted SMS message sent by the app's server, i.e., via navigator.credentials.get({otp: ..., ...}).

Specifically, where a defined policy blocks the use of this feature, the Promise returned by `navigator.credentials.get({otp})` will reject with a `SecurityError` DOMException.

## Syntax

```http
Permissions-Policy: otp-credentials=<allowlist>;
```

- `<allowlist>`
- : A list of origins for which permission is granted to use the feature. See [`Permissions-Policy` > Syntax](/docs/Web/HTTP/Reference/Headers/Permissions-Policy#syntax) for more details.

## Default policy

The default allowlist for `otp-credentials` is `self`.

## Specifications

## Browser compatibility

## See also

- Permissions-Policy header
- [Permissions Policy](/docs/Web/HTTP/Guides/Permissions_Policy)
- [WebOTP API](/docs/Web/API/WebOTP_API)
- OTPCredential interface

source: MDN Web Docs mirror · page

Cite this

"Permissions-Policy: otp-credentials directive". MDN Web Docs. CC BY-SA 2.5 (MDN). https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Permissions-Policy/otp-credentials

JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy

Save to pass ·