Back to Content

Permissions-Policy: otp-credentials directive

files/en-us/web/http/reference/headers/permissions-policy/otp-credentials/index.md

latest1.2 KB
Original Source

{{SeeCompatTable}}

The HTTP {{HTTPHeader("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 {{domxref("CredentialsContainer.get", "navigator.credentials.get({otp: ..., ...})")}}.

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

Syntax

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

Default policy

The default allowlist for otp-credentials is self.

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also