Permissions-Policy: chỉ thị otp-credentials
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
Chỉ thị otp-credentials của header HTTP Permissions-Policy kiểm soát việc tài liệu hiện tại có được phép sử dụng WebOTP API để yêu cầu mật khẩu dùng một lần (OTP) từ tin nhắn SMS có định dạng đặc biệt được gửi bởi máy chủ của ứng dụng, tức là thông qua navigator.credentials.get({otp: ..., ...}) hay không.
Cụ thể, khi một chính sách đã được xác định chặn việc sử dụng tính năng này, Promise được trả về bởi navigator.credentials.get({otp}) sẽ bị từ chối với SecurityError DOMException.
Cú pháp
Permissions-Policy: otp-credentials=<allowlist>;
<allowlist>-
Danh sách các nguồn gốc được cấp quyền sử dụng tính năng. Xem
Permissions-Policy> Cú pháp để biết thêm chi tiết.
Chính sách mặc định
Danh sách cho phép mặc định cho otp-credentials là self.
Thông số kỹ thuật
| Specification |
|---|
| WebOTP API> # sctn-permissions-policy> |
Tương thích trình duyệt
Xem thêm
- Header
Permissions-Policy - Permissions Policy
- WebOTP API
- Giao diện
OTPCredential