Permissions-Policy: chỉ thị publickey-credentials-create
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ị publickey-credentials-create 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 Web Authentication API để tạo thông tin xác thực WebAuthn mới, tức là thông qua navigator.credentials.create({publicKey}) 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.create({publicKey}) sẽ bị từ chối với NotAllowedError DOMException.
Nếu phương thức được gọi cross-origin, Promise cũng sẽ bị từ chối với NotAllowedError nếu tính năng được cấp bởi allow= trên một iframe và frame đó không có Transient activation.
Cú pháp
Permissions-Policy: publickey-credentials-create=<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 publickey-credentials-create là self.
Thông số kỹ thuật
| Specification |
|---|
| Web Authentication: An API for accessing Public Key Credentials - Level 3> # sctn-permissions-policy> |
Tương thích trình duyệt
Xem thêm
- Header
Permissions-Policy - Permissions Policy
- Web Authentication API
- Giao diện
PublicKeyCredential