# WebauthnAuthenticationFlows

## Methods

### modal

▸ **modal**(`params`): `Promise`<`string`>

Invokes a WebAuthn authentication, including prompting the user to select from a list of registered credentials, and then prompting the user for biometrics. The credentials list is displayed using the native browser modal.
If username isn't provided, it will promote a modal with a list of all discoverable credentials on the device. If username is provided, this call must be invoked for a registered username. If the target username is not registered or in case of any other failure, an SdkError will be thrown.
If authentication is completed successfully, this call will return a promise that resolves to the credential result, which is an object encoded as a base64 string. This encoded result should then be passed to the [backend authentication endpoint](/openapi/user/backend-webauthn.openapi/other/authenticatewebauthncredential) to retrieve user tokens.

**`Throws`**

[NotInitialized](/sdk-ref/authnsdk/enums/errorcode#notinitialized)

**`Throws`**

[AuthenticationFailed](/sdk-ref/authnsdk/enums/errorcode#authenticationfailed)

**`Throws`**

[AuthenticationCanceled](/sdk-ref/authnsdk/enums/errorcode#authenticationcanceled)

**`Throws`**

[InvalidApprovalData](/sdk-ref/authnsdk/enums/errorcode#invalidapprovaldata)

**`Throws`**

[AuthenticationProcessAlreadyActive](/sdk-ref/authnsdk/enums/errorcode#authenticationprocessalreadyactive)

#### Parameters

| Name | Type |
|  --- | --- |
| `params` | { `username?`: `string` ; `options?`: [`WebauthnAuthenticationOptions`](/sdk-ref/authnsdk/interfaces/webauthnauthenticationoptions)  } | { `identifier?`: `string` ; `identifierType?`: `string` ; `options?`: [`WebauthnAuthenticationOptions`](/sdk-ref/authnsdk/interfaces/webauthnauthenticationoptions)  } |


#### Returns

`Promise`<`string`>

Base64-encoded object, which contains the credential result. This encoded result will be used to fetch user tokens via the [backend authentication endpoint](/openapi/user/backend-webauthn.openapi/other/authenticatewebauthncredential).

## Properties

### autofill

• **autofill**: [`AutofillHandlers`](/sdk-ref/authnsdk/interfaces/autofillhandlers)

Property used to implement credential selection via autofill UI.