Permissions-Policy: otp-credentials 指令
HTTP Permissions-Policy
头部中的 otp-credentials
指令控制当前文档是否允许使用 WebOTP API 从应用程序服务器发送的特殊格式短信中请求一次性密码 (OTP),即通过 navigator.credentials.get({otp: ..., ...})
。
具体来说,如果定义的策略阻止使用此功能,则由 navigator.credentials.get({otp})
返回的 Promise
将因 SecurityError
DOMException
而被拒绝。
语法
http
Permissions-Policy: otp-credentials=<allowlist>;
<allowlist>
-
被授予使用此功能权限的源列表。有关更多详细信息,请参阅
Permissions-Policy
> 语法。
默认策略
otp-credentials
的默认允许列表是 self
。
规范
规范 |
---|
WebOTP API # sctn-permissions-policy |
浏览器兼容性
加载中…