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 CredentialsContainer.get.
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
Permissions-Policy: otp-credentials=<allowlist>;
<allowlist>- : A list of origins for which permission is granted to use the feature. See
Permissions-Policy> Syntax for more details.
- : A list of origins for which permission is granted to use the feature. See
Default policy
The default allowlist for otp-credentials is self.
Specifications
Browser compatibility
See also
- Permissions-Policy header
- Permissions Policy
- WebOTP API
- OTPCredential interface
来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。
