这是 实验性技术
检查 浏览器兼容性表格 要小心谨慎在生产中使用这之前。

安全上下文
此特征只可用于 安全上下文 (HTTPS),在某些或所有 支持浏览器 .

CredentialsContainer 接口的 证书管理 API exposes methods to request credentials and notify the user agent when events such as successful sign in or sign out happen. This interface is accessible from Navigator.credentials .

特性

None.

事件处理程序

None.

方法

CredentialsContainer.create() 安全上下文
返回 Promise that resolves with a new Credential instance based on the provided options, or null if no Credential object can be created. In exceptional circumstances, the Promise may reject.
CredentialsContainer.get() 安全上下文
返回 Promise that resolves with the Credential instance that matches the provided parameters.
CredentialsContainer.preventSilentAccess() 安全上下文
Sets a flag that specifies whether automatic log in is allowed for future visits to the current origin, then returns an empty Promise . For example, you might call this, after a user signs out of a website to ensure that he/she isn't automatically signed in on the next site visit. Earlier versions of the spec called this method requireUserMediation() 。见 浏览器兼容性 for support details.
CredentialsContainer.store() 安全上下文
Stores a set of credentials for a user, inside a provided Credential instance and returns that instance in a Promise .

范例

// TBD
					

规范

规范 状态 注释
Credential Management Level 1 工作草案 初始定义。
Web Authentication: An API for accessing Public Key Credentials Level 1 推荐 初始定义。

浏览器兼容性

The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. 更新 GitHub 上的兼容性数据
桌面 移动
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
CredentialsContainer Chrome 51 Edge 18 Firefox Yes IE ? Opera 不支持 No Safari 13 WebView Android 51 Chrome Android 51 Firefox Android Yes Opera Android 不支持 No Safari iOS 13.3 Samsung Internet Android 5.0
create Chrome 60 Edge 18 Firefox Yes IE ? Opera 不支持 No Safari 13 WebView Android 60 Chrome Android 60 Firefox Android Yes Opera Android 不支持 No Safari iOS 13.3 Samsung Internet Android 8.0
get Chrome 51 Edge 18 Firefox Yes IE ? Opera 不支持 No Safari 13 WebView Android 51 Chrome Android 51 Firefox Android Yes Opera Android 不支持 No Safari iOS 13.3 Samsung Internet Android 5.0
preventSilentAccess Chrome 60
60
51 — 60 Alternate Name
Alternate Name Uses the non-standard name: requireUserMediation
Edge ≤79 Firefox Yes IE ? Opera 不支持 No Safari ? WebView Android 60
60
51 — 60 Alternate Name
Alternate Name Uses the non-standard name: requireUserMediation
Chrome Android 60
60
51 — 60 Alternate Name
Alternate Name Uses the non-standard name: requireUserMediation
Firefox Android Yes Opera Android 不支持 No Safari iOS ? Samsung Internet Android 8.0
8.0
5.0 — 8.0 Alternate Name
Alternate Name Uses the non-standard name: requireUserMediation
store Chrome 51 Edge ≤79 Firefox Yes IE ? Opera 不支持 No Safari ? WebView Android 51 Chrome Android 51 Firefox Android Yes Opera Android 不支持 No Safari iOS ? Samsung Internet Android 5.0

图例

完整支持

完整支持

不支持

不支持

兼容性未知 ?

兼容性未知

实验。期望将来行为有所改变。

实验。期望将来行为有所改变。

使用非标名称。

使用非标名称。

元数据

  • 最后修改:
  1. 证书管理 API
  2. CredentialsContainer
  3. 方法
    1. create()
    2. get()
    3. preventSilentAccess()
    4. store()
  4. Related pages for Credential Management API
    1. Credential
    2. FederatedCredential
    3. PasswordCredential

版权所有  © 2014-2026 乐数软件    

工业和信息化部: 粤ICP备14079481号-1