PassKey
npm install @darkedges/capacitor-native-webauthn
npx cap sync
isWebAuthnAvailable()
isWebAuthnAutoFillAvailable()
startRegistration(...)
startAuthentication(...)
- Interfaces
- Type Aliases
isWebAuthnAvailable() => Promise<{ value: boolean; }>
Returns: Promise<{ value: boolean; }>
isWebAuthnAutoFillAvailable() => Promise<{ value: boolean; }>
Returns: Promise<{ value: boolean; }>
startRegistration(publicKeyCredentialCreationOptionsJSON: PublicKeyCredentialCreationOptionsJSON) => Promise<RegistrationResponseJSON>
Param | Type |
---|---|
publicKeyCredentialCreationOptionsJSON |
PublicKeyCredentialCreationOptionsJSON |
Returns: Promise<RegistrationResponseJSON>
startAuthentication(requestOptionsJSON: PublicKeyCredentialRequestOptionsJSON, useBrowserAutofill?: boolean | undefined) => Promise<AuthenticationResponseJSON>
Param | Type |
---|---|
requestOptionsJSON |
PublicKeyCredentialRequestOptionsJSON |
useBrowserAutofill |
boolean |
Returns: Promise<AuthenticationResponseJSON>
A slightly-modified RegistrationCredential to simplify working with ArrayBuffers that are Base64URL-encoded in the browser so that they can be sent as JSON to the server.
https://w3c.github.io/webauthn/#dictdef-registrationresponsejson
Prop | Type |
---|---|
id |
Base64URLString |
rawId |
Base64URLString |
response |
AuthenticatorAttestationResponseJSON |
authenticatorAttachment |
AuthenticatorAttachment |
clientExtensionResults |
AuthenticationExtensionsClientOutputs |
type |
PublicKeyCredentialType |
A slightly-modified AuthenticatorAttestationResponse to simplify working with ArrayBuffers that are Base64URL-encoded in the browser so that they can be sent as JSON to the server.
https://w3c.github.io/webauthn/#dictdef-authenticatorattestationresponsejson
Prop | Type |
---|---|
clientDataJSON |
Base64URLString |
attestationObject |
Base64URLString |
authenticatorData |
Base64URLString |
transports |
AuthenticatorTransportFuture[] |
publicKeyAlgorithm |
COSEAlgorithmIdentifier |
publicKey |
Base64URLString |
Prop | Type |
---|---|
appid |
boolean |
credProps |
CredentialPropertiesOutput |
hmacCreateSecret |
boolean |
Prop | Type |
---|---|
rk |
boolean |
A variant of PublicKeyCredentialCreationOptions suitable for JSON transmission to the browser to (eventually) get passed into navigator.credentials.create(...) in the browser.
This should eventually get replaced with official TypeScript DOM types when WebAuthn L3 types eventually make it into the language:
https://w3c.github.io/webauthn/#dictdef-publickeycredentialcreationoptionsjson
Prop | Type |
---|---|
rp |
PublicKeyCredentialRpEntity |
user |
PublicKeyCredentialUserEntityJSON |
challenge |
Base64URLString |
pubKeyCredParams |
PublicKeyCredentialParameters[] |
timeout |
number |
excludeCredentials |
PublicKeyCredentialDescriptorJSON[] |
authenticatorSelection |
AuthenticatorSelectionCriteria |
attestation |
AttestationConveyancePreference |
extensions |
AuthenticationExtensionsClientInputs |
Prop | Type |
---|---|
id |
string |
https://w3c.github.io/webauthn/#dictdef-publickeycredentialuserentityjson
Prop | Type |
---|---|
id |
string |
name |
string |
displayName |
string |
Prop | Type |
---|---|
alg |
COSEAlgorithmIdentifier |
type |
PublicKeyCredentialType |
https://w3c.github.io/webauthn/#dictdef-publickeycredentialdescriptorjson
Prop | Type |
---|---|
id |
Base64URLString |
type |
PublicKeyCredentialType |
transports |
AuthenticatorTransportFuture[] |
Prop | Type |
---|---|
authenticatorAttachment |
AuthenticatorAttachment |
requireResidentKey |
boolean |
residentKey |
ResidentKeyRequirement |
userVerification |
UserVerificationRequirement |
Prop | Type |
---|---|
appid |
string |
credProps |
boolean |
hmacCreateSecret |
boolean |
A slightly-modified AuthenticationCredential to simplify working with ArrayBuffers that are Base64URL-encoded in the browser so that they can be sent as JSON to the server.
https://w3c.github.io/webauthn/#dictdef-authenticationresponsejson
Prop | Type |
---|---|
id |
Base64URLString |
rawId |
Base64URLString |
response |
AuthenticatorAssertionResponseJSON |
authenticatorAttachment |
AuthenticatorAttachment |
clientExtensionResults |
AuthenticationExtensionsClientOutputs |
type |
PublicKeyCredentialType |
A slightly-modified AuthenticatorAssertionResponse to simplify working with ArrayBuffers that are Base64URL-encoded in the browser so that they can be sent as JSON to the server.
https://w3c.github.io/webauthn/#dictdef-authenticatorassertionresponsejson
Prop | Type |
---|---|
clientDataJSON |
Base64URLString |
authenticatorData |
Base64URLString |
signature |
Base64URLString |
userHandle |
string |
A variant of PublicKeyCredentialRequestOptions suitable for JSON transmission to the browser to (eventually) get passed into navigator.credentials.get(...) in the browser.
Prop | Type |
---|---|
challenge |
Base64URLString |
timeout |
number |
rpId |
string |
allowCredentials |
PublicKeyCredentialDescriptorJSON[] |
userVerification |
UserVerificationRequirement |
extensions |
AuthenticationExtensionsClientInputs |
An attempt to communicate that this isn't just any string, but a Base64URL-encoded string
string
A super class of TypeScript's AuthenticatorTransport
that includes support for the latest
transports. Should eventually be replaced by TypeScript's when TypeScript gets updated to
know about it (sometime after 4.6.3)
'ble' | 'cable' | 'hybrid' | 'internal' | 'nfc' | 'smart-card' | 'usb'
number
"cross-platform" | "platform"
"public-key"
"discouraged" | "preferred" | "required"
"discouraged" | "preferred" | "required"
"direct" | "enterprise" | "indirect" | "none"