PublicKeyCredential.rawId
安全なコンテキスト用
この機能は一部またはすべての対応しているブラウザーにおいて、安全なコンテキスト (HTTPS) でのみ利用できます。
rawId
は PublicKeyCredential
インターフェイスの読み取り専用プロパティで、証明書の識別子が入った ArrayBuffer
オブジェクトです。
PublicKeyCredential.id
(en-US) プロパティはこの識別子が base64url エンコードされたものです。
メモ: このプロパティは最上位のコンテキストでしか使えない可能性があり、例えば <iframe>
の中では利用できません。
構文
rawId = publicKeyCredential.rawId
値
ArrayBuffer
で、証明書の識別子が入っています。この識別子はグローバルに固有で、現在の PublicKeyCredential
および関連する AuthenticatorAssertionResponse
を指しています。
例
var options = {
challenge: new Uint8Array(26) /* from the server */,
rp: {
name: "Example CORP",
id : "login.example.com"
},
user: {
id: new Uint8Array(26), /* To be changed for each user */
name: "jdoe@example.com",
displayName: "John Doe",
},
pubKeyCredParams: [
{
type: "public-key",
alg: -7
}
]
};
navigator.credentials.create({ publickey: options })
.then(function (pubKeyCredential) {
var rawId = pubKeyCredential.rawId;
// Do something with rawId
}).catch(function (err) {
// Deal with any error
});
仕様書
ブラウザーの対応
BCD tables only load in the browser