WebAuthnIdentity
Defined in: packages/identity/src/identity/webauthn.ts:137
A SignIdentity that uses navigator.credentials
. See https://webauthn.guide/ for
more information about WebAuthentication.
Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new WebAuthnIdentity(
rawId
,cose
,authenticatorAttachment
):WebAuthnIdentity
Defined in: packages/identity/src/identity/webauthn.ts:184
Parameters
Section titled “Parameters”Uint8Array
Uint8Array
authenticatorAttachment
Section titled “authenticatorAttachment”undefined
| AuthenticatorAttachment
Returns
Section titled “Returns”WebAuthnIdentity
Overrides
Section titled “Overrides”Properties
Section titled “Properties”_principal
Section titled “_principal”
protected
_principal:undefined
|Principal
Defined in: packages/agent/lib/esm/auth.d.ts:52
Inherited from
Section titled “Inherited from”_publicKey
Section titled “_publicKey”
protected
_publicKey:CosePublicKey
Defined in: packages/identity/src/identity/webauthn.ts:182
authenticatorAttachment
Section titled “authenticatorAttachment”
protected
authenticatorAttachment:undefined
|AuthenticatorAttachment
Defined in: packages/identity/src/identity/webauthn.ts:187
readonly
rawId:Uint8Array
Defined in: packages/identity/src/identity/webauthn.ts:185
Methods
Section titled “Methods”getAuthenticatorAttachment()
Section titled “getAuthenticatorAttachment()”getAuthenticatorAttachment():
undefined
|AuthenticatorAttachment
Defined in: packages/identity/src/identity/webauthn.ts:205
WebAuthn level 3 spec introduces a new attribute on successful WebAuthn interactions, see https://w3c.github.io/webauthn/#dom-publickeycredential-authenticatorattachment. This attribute is already implemented for Chrome, Safari and Edge.
Given the attribute is only available after a successful interaction, the information is
provided opportunistically and might also be undefined
.
Returns
Section titled “Returns”undefined
| AuthenticatorAttachment
getPrincipal()
Section titled “getPrincipal()”getPrincipal():
Principal
Defined in: packages/agent/lib/esm/auth.d.ts:65
Get the principal represented by this identity. Normally should be a
Principal.selfAuthenticating()
.
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”getPublicKey()
Section titled “getPublicKey()”getPublicKey():
PublicKey
Defined in: packages/identity/src/identity/webauthn.ts:193
Returns the public key that would match this identity’s signature.
Returns
Section titled “Returns”Overrides
Section titled “Overrides”sign()
Section titled “sign()”sign(
blob
):Promise
<Signature
>
Defined in: packages/identity/src/identity/webauthn.ts:209
Signs a blob of data, with this identity’s private key.
Parameters
Section titled “Parameters”Uint8Array
Returns
Section titled “Returns”Promise
<Signature
>
Overrides
Section titled “Overrides”toJSON()
Section titled “toJSON()”toJSON():
JsonnableWebAuthnIdentity
Defined in: packages/identity/src/identity/webauthn.ts:249
Allow for JSON serialization of all information needed to reuse this identity.
Returns
Section titled “Returns”JsonnableWebAuthnIdentity
transformRequest()
Section titled “transformRequest()”transformRequest(
request
):Promise
<unknown
>
Defined in: packages/agent/lib/esm/auth.d.ts:72
Transform a request into a signed version of the request. This is done last after the transforms on the body of a request. The returned object can be anything, but must be serializable to CBOR.
Parameters
Section titled “Parameters”request
Section titled “request”internet computer request to transform
Returns
Section titled “Returns”Promise
<unknown
>
Inherited from
Section titled “Inherited from”create()
Section titled “create()”
static
create(credentialCreationOptions?
):Promise
<WebAuthnIdentity
>
Defined in: packages/identity/src/identity/webauthn.ts:156
Create an identity.
Parameters
Section titled “Parameters”credentialCreationOptions?
Section titled “credentialCreationOptions?”CredentialCreationOptions
an optional CredentialCreationOptions Challenge
Returns
Section titled “Returns”Promise
<WebAuthnIdentity
>
fromJSON()
Section titled “fromJSON()”
static
fromJSON(json
):WebAuthnIdentity
Defined in: packages/identity/src/identity/webauthn.ts:142
Create an identity from a JSON serialization.
Parameters
Section titled “Parameters”string
json to parse
Returns
Section titled “Returns”WebAuthnIdentity