selectAuthenticator

abstract suspend fun selectAuthenticator(authenticator: Authenticator): Authenticator?

Select the authenticator to authenticate the user. This method will select the authenticator to authenticate the user and get the details of the selected authenticator.

This method will only select the authenticator and will not authenticate the user. This method should be called before calling the authenticate method, and does not require to call before other specific authenticate methods.

Example: Assume you want to authenticate the user with the Email OTP authenticator as a first factor authenticator.

val detailedAuthenticator = authenticationProvider.selectAuthenticator(authenticator = authenticator)
...
// for username
authenticationProvider.authenticate(
context = context,
authenticator: detailedAuthenticator,
authParams = <Parameters as a LinkedHashMap>
)

...

// for email otp
authenticationProvider.authenticate(
context = context,
authenticator: detailedAuthenticator,
authParams = <Parameters as a LinkedHashMap>
)

emit: AuthenticationState.Loading - The application is in the process of loading the authentication state

emit: AuthenticationState.Error - An error occurred during the authentication process

Return

The selected authenticator with the details as a Authenticator object

Parameters

authenticator

The selected authenticator