Giter VIP home page Giter VIP logo

capacitor-native-webauthn's Introduction

@darkedges/capacitor-native-webauthn

PassKey

Install

npm install @darkedges/capacitor-native-webauthn
npx cap sync

API

isWebAuthnAvailable()

isWebAuthnAvailable() => Promise<{ value: boolean; }>

Returns: Promise<{ value: boolean; }>


isWebAuthnAutoFillAvailable()

isWebAuthnAutoFillAvailable() => Promise<{ value: boolean; }>

Returns: Promise<{ value: boolean; }>


startRegistration(...)

startRegistration(publicKeyCredentialCreationOptionsJSON: PublicKeyCredentialCreationOptionsJSON) => Promise<RegistrationResponseJSON>
Param Type
publicKeyCredentialCreationOptionsJSON PublicKeyCredentialCreationOptionsJSON

Returns: Promise<RegistrationResponseJSON>


startAuthentication(...)

startAuthentication(requestOptionsJSON: PublicKeyCredentialRequestOptionsJSON, useBrowserAutofill?: boolean | undefined) => Promise<AuthenticationResponseJSON>
Param Type
requestOptionsJSON PublicKeyCredentialRequestOptionsJSON
useBrowserAutofill boolean

Returns: Promise<AuthenticationResponseJSON>


Interfaces

RegistrationResponseJSON

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

AuthenticatorAttestationResponseJSON

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

AuthenticationExtensionsClientOutputs

Prop Type
appid boolean
credProps CredentialPropertiesOutput
hmacCreateSecret boolean

CredentialPropertiesOutput

Prop Type
rk boolean

PublicKeyCredentialCreationOptionsJSON

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

PublicKeyCredentialRpEntity

Prop Type
id string

PublicKeyCredentialUserEntityJSON

https://w3c.github.io/webauthn/#dictdef-publickeycredentialuserentityjson

Prop Type
id string
name string
displayName string

PublicKeyCredentialParameters

Prop Type
alg COSEAlgorithmIdentifier
type PublicKeyCredentialType

PublicKeyCredentialDescriptorJSON

https://w3c.github.io/webauthn/#dictdef-publickeycredentialdescriptorjson

Prop Type
id Base64URLString
type PublicKeyCredentialType
transports AuthenticatorTransportFuture[]

AuthenticatorSelectionCriteria

Prop Type
authenticatorAttachment AuthenticatorAttachment
requireResidentKey boolean
residentKey ResidentKeyRequirement
userVerification UserVerificationRequirement

AuthenticationExtensionsClientInputs

Prop Type
appid string
credProps boolean
hmacCreateSecret boolean

AuthenticationResponseJSON

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

AuthenticatorAssertionResponseJSON

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

PublicKeyCredentialRequestOptionsJSON

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

Type Aliases

Base64URLString

An attempt to communicate that this isn't just any string, but a Base64URL-encoded string

string

AuthenticatorTransportFuture

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'

COSEAlgorithmIdentifier

number

AuthenticatorAttachment

"cross-platform" | "platform"

PublicKeyCredentialType

"public-key"

ResidentKeyRequirement

"discouraged" | "preferred" | "required"

UserVerificationRequirement

"discouraged" | "preferred" | "required"

AttestationConveyancePreference

"direct" | "enterprise" | "indirect" | "none"

capacitor-native-webauthn's People

Contributors

darkedges avatar piotr-cz avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.