# BiometricPrompt.AuthenticationCallback

Artifact: [androidx.biometric:biometric](https://developer.android.com/jetpack/androidx/releases/biometric) [View Source](https://cs.android.com/search?q=file:androidx/biometric/BiometricPrompt.java+class:androidx.biometric.BiometricPrompt.AuthenticationCallback) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/biometric#1.0.0)

*** ** * ** ***


```
abstract class BiometricPrompt.AuthenticationCallback
```

<br />

*** ** * ** ***

A collection of methods that may be invoked by `https://developer.android.com/reference/kotlin/androidx/biometric/BiometricPrompt` during authentication.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/biometric/BiometricPrompt.AuthenticationCallback#AuthenticationCallback()()` |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/biometric/BiometricPrompt.AuthenticationCallback#onAuthenticationError(int,java.lang.CharSequence)(errorCode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, errString: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html)` Called when an unrecoverable error has been encountered and authentication has stopped. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/biometric/BiometricPrompt.AuthenticationCallback#onAuthenticationFailed()()` Called when a biometric (e.g. fingerprint, face, etc.) is presented but not recognized as belonging to the user. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/biometric/BiometricPrompt.AuthenticationCallback#onAuthenticationSucceeded(androidx.biometric.BiometricPrompt.AuthenticationResult)(result: https://developer.android.com/reference/kotlin/androidx/biometric/BiometricPrompt.AuthenticationResult)` Called when a biometric (e.g. fingerprint, face, etc.) is recognized, indicating that the user has successfully authenticated. |

## Public constructors

### AuthenticationCallback

Added in 1.0.0

```
AuthenticationCallback()
```

## Public functions

### onAuthenticationError

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/biometric#1.0.0)

```
fun onAuthenticationError(errorCode: Int, errString: CharSequence): Unit
```

Called when an unrecoverable error has been encountered and authentication has stopped.

After this method is called, no further events will be sent for the current authentication session.

| Parameters |
|---|---|
| `errorCode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | An integer ID associated with the error. |
| `errString: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html` | A human-readable string that describes the error. |

### onAuthenticationFailed

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/biometric#1.0.0)

```
fun onAuthenticationFailed(): Unit
```

Called when a biometric (e.g. fingerprint, face, etc.) is presented but not recognized as belonging to the user.

### onAuthenticationSucceeded

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/biometric#1.0.0)

```
fun onAuthenticationSucceeded(result: BiometricPrompt.AuthenticationResult): Unit
```

Called when a biometric (e.g. fingerprint, face, etc.) is recognized, indicating that the user has successfully authenticated.

After this method is called, no further events will be sent for the current authentication session.

| Parameters |
|---|---|
| `result: https://developer.android.com/reference/kotlin/androidx/biometric/BiometricPrompt.AuthenticationResult` | An object containing authentication-related data. |