Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@wearemothership/capacitor-native-webauthn

Package Overview
Dependencies
Maintainers
0
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wearemothership/capacitor-native-webauthn

This plugin gives access to the native webauthn / passkey apis for android/ios

  • 0.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

@darkedges/capacitor-native-webauthn

PassKey

Install

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

API

  • isWebAuthnAvailable()
  • isWebAuthnAutoFillAvailable()
  • startRegistration(...)
  • startAuthentication(...)
  • Interfaces
  • Type Aliases

isWebAuthnAvailable()

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

Returns: Promise<{ value: boolean; }>


isWebAuthnAutoFillAvailable()

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

Returns: Promise<{ value: boolean; }>


startRegistration(...)

startRegistration(publicKeyCredentialCreationOptionsJSON: PublicKeyCredentialCreationOptionsJSON) => Promise<RegistrationResponseJSON>
ParamType
publicKeyCredentialCreationOptionsJSONPublicKeyCredentialCreationOptionsJSON

Returns: Promise<RegistrationResponseJSON>


startAuthentication(...)

startAuthentication(requestOptionsJSON: PublicKeyCredentialRequestOptionsJSON, useBrowserAutofill?: boolean | undefined) => Promise<AuthenticationResponseJSON>
ParamType
requestOptionsJSONPublicKeyCredentialRequestOptionsJSON
useBrowserAutofillboolean

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

PropType
idBase64URLString
rawIdBase64URLString
responseAuthenticatorAttestationResponseJSON
authenticatorAttachmentAuthenticatorAttachment
clientExtensionResultsAuthenticationExtensionsClientOutputs
typePublicKeyCredentialType
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

PropType
clientDataJSONBase64URLString
attestationObjectBase64URLString
authenticatorDataBase64URLString
transportsAuthenticatorTransportFuture[]
publicKeyAlgorithmCOSEAlgorithmIdentifier
publicKeyBase64URLString
AuthenticationExtensionsClientOutputs
PropType
appidboolean
credPropsCredentialPropertiesOutput
hmacCreateSecretboolean
CredentialPropertiesOutput
PropType
rkboolean
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

PropType
rpPublicKeyCredentialRpEntity
userPublicKeyCredentialUserEntityJSON
challengeBase64URLString
pubKeyCredParamsPublicKeyCredentialParameters[]
timeoutnumber
excludeCredentialsPublicKeyCredentialDescriptorJSON[]
authenticatorSelectionAuthenticatorSelectionCriteria
attestationAttestationConveyancePreference
extensionsAuthenticationExtensionsClientInputs
PublicKeyCredentialRpEntity
PropType
idstring
PublicKeyCredentialUserEntityJSON

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

PropType
idstring
namestring
displayNamestring
PublicKeyCredentialParameters
PropType
algCOSEAlgorithmIdentifier
typePublicKeyCredentialType
PublicKeyCredentialDescriptorJSON

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

PropType
idBase64URLString
typePublicKeyCredentialType
transportsAuthenticatorTransportFuture[]
AuthenticatorSelectionCriteria
PropType
authenticatorAttachmentAuthenticatorAttachment
requireResidentKeyboolean
residentKeyResidentKeyRequirement
userVerificationUserVerificationRequirement
AuthenticationExtensionsClientInputs
PropType
appidstring
credPropsboolean
hmacCreateSecretboolean
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

PropType
idBase64URLString
rawIdBase64URLString
responseAuthenticatorAssertionResponseJSON
authenticatorAttachmentAuthenticatorAttachment
clientExtensionResultsAuthenticationExtensionsClientOutputs
typePublicKeyCredentialType
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

PropType
clientDataJSONBase64URLString
authenticatorDataBase64URLString
signatureBase64URLString
userHandleBase64URLString
PublicKeyCredentialRequestOptionsJSON

A variant of PublicKeyCredentialRequestOptions suitable for JSON transmission to the browser to (eventually) get passed into navigator.credentials.get(...) in the browser.

PropType
challengeBase64URLString
timeoutnumber
rpIdstring
allowCredentialsPublicKeyCredentialDescriptorJSON[]
userVerificationUserVerificationRequirement
extensionsAuthenticationExtensionsClientInputs

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"

Keywords

FAQs

Package last updated on 25 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc