capacitor-webauthn
v0.0.12
Published
includes passkey registration and authentication methods for ios and android
Readme
capacitor-webauthn
includes passkey registration and authentication methods for ios and android
Install
npm install capacitor-webauthn
npx cap syncAPI
isWebAuthnAvailable()
isWebAuthnAvailable() => Promise<{ value: boolean; }>Returns: Promise<{ value: boolean; }>
startRegistration(...)
startRegistration(publicKeyCredentialCreationOptionsJSON: PublicKeyCredentialCreationOptionsJSON) => Promise<RegistrationResponseJSON>| Param | Type |
| -------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
| publicKeyCredentialCreationOptionsJSON | PublicKeyCredentialCreationOptionsJSON |
Returns: Promise<RegistrationResponseJSON>
startAuthentication(...)
startAuthentication(requestOptionsJSON: PublicKeyCredentialRequestOptionsJSON) => Promise<AuthenticationResponseJSON>| Param | Type |
| ------------------------ | ------------------------------------------------------------------------------------------------------- |
| requestOptionsJSON | PublicKeyCredentialRequestOptionsJSON |
Returns: Promise<AuthenticationResponseJSON>
Interfaces
RegistrationResponseJSON
| Prop | Type |
| ----------------------------- | ------------------------------------------------------------------------------------------------------- |
| id | Base64URLString |
| rawId | Base64URLString |
| response | AuthenticatorAttestationResponseJSON |
| authenticatorAttachment | AuthenticatorAttachment |
| clientExtensionResults | AuthenticationExtensionsClientOutputs |
| type | PublicKeyCredentialType |
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
| 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 |
| name | string |
PublicKeyCredentialUserEntityJSON
| Prop | Type |
| ----------------- | ------------------- |
| id | string |
| name | string |
| displayName | string |
PublicKeyCredentialParameters
| Prop | Type |
| ---------- | --------------------------------------------------------------------------- |
| alg | COSEAlgorithmIdentifier |
| type | PublicKeyCredentialType |
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
| Prop | Type |
| ----------------------------- | ------------------------------------------------------------------------------------------------------- |
| id | Base64URLString |
| rawId | Base64URLString |
| response | AuthenticatorAssertionResponseJSON |
| authenticatorAttachment | AuthenticatorAttachment |
| clientExtensionResults | AuthenticationExtensionsClientOutputs |
| type | PublicKeyCredentialType |
AuthenticatorAssertionResponseJSON
| Prop | Type |
| ----------------------- | ----------------------------------------------------------- |
| clientDataJSON | Base64URLString |
| authenticatorData | Base64URLString |
| signature | Base64URLString |
| userHandle | string |
PublicKeyCredentialRequestOptionsJSON
| Prop | Type |
| ---------------------- | ----------------------------------------------------------------------------------------------------- |
| challenge | Base64URLString |
| timeout | number |
| rpId | string |
| allowCredentials | PublicKeyCredentialDescriptorJSON[] |
| userVerification | UserVerificationRequirement |
| extensions | AuthenticationExtensionsClientInputs |
Type Aliases
Base64URLString
string
AuthenticatorTransportFuture
'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'
