Credential

Baseline Widely available *

This feature is well established and works across many devices and browser versions. It’s been available across browsers since January 2020.

* Some parts of this feature may have varying levels of support.

安全なコンテキスト用: この機能は一部またはすべての対応しているブラウザーにおいて、安全なコンテキスト (HTTPS) でのみ利用できます。

Credential資格情報管理 API のインターフェイスで、信頼の判断に必要なエンティティ(普通はユーザー)についての情報を提供します。

Credential オブジェクトには 4 つの異なる型になる可能性があります。

プロパティ

Credential.id 読取専用

認証情報の識別子の入った文字列を返します。これは GUID、ユーザー名、メールアドレスのいずれかになる可能性があります。

Credential.type 読取専用

認証情報の種別の入った文字列を返します。有効な値は password, federated, public-key の何れかです。(それぞれ PasswordCredential, FederatedCredential, PublicKeyCredential

イベントハンドラー

なし

メソッド

なし

js
let pwdCredential = new PasswordCredential({
  id: "example-username", // Username/ID
  name: "Carina Anand", // Display name
  password: "correct horse battery staple", // Password
});

console.assert(pwdCredential.type === "password");

仕様書

Specification
Credential Management Level 1
# the-credential-interface

ブラウザーの互換性

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
Credential
id
isConditionalMediationAvailable() static method
Experimental
type

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
Experimental. Expect behavior to change in the future.