Added in [version 37.2](https://developer.android.com/topic/libraries/support-library/revisions) Summary: [Ctors](https://developer.android.com/reference/android/hardware/biometrics/EmbeddedBiometricPrompt.AuthenticationCallback#pubctors) \| [Methods](https://developer.android.com/reference/android/hardware/biometrics/EmbeddedBiometricPrompt.AuthenticationCallback#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/hardware/biometrics/EmbeddedBiometricPrompt.AuthenticationCallback#inhmethods)

# EmbeddedBiometricPrompt.AuthenticationCallback

*** ** * ** ***


`
public
static

abstract
class
EmbeddedBiometricPrompt.AuthenticationCallback
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


`

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.hardware.biometrics.EmbeddedBiometricPrompt.AuthenticationCallback |

<br />

*** ** * ** ***

Callback structure provided to `https://developer.android.com/reference/android/hardware/biometrics/EmbeddedBiometricPrompt#startAuthenticationSession(android.os.CancellationSignal,%20int,%20java.util.concurrent.Executor,%20android.hardware.biometrics.EmbeddedBiometricPrompt.AuthenticationCallback)`. Users must provide an
implementation of this for listening to authentication events.

## Summary

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/hardware/biometrics/EmbeddedBiometricPrompt.AuthenticationCallback#AuthenticationCallback()() ` |

| ### Public methods ||
|---|---|
| ` void` | ` https://developer.android.com/reference/android/hardware/biometrics/EmbeddedBiometricPrompt.AuthenticationCallback#onAuthenticationError(int,%20java.lang.CharSequence)(int errorCode, https://developer.android.com/reference/java/lang/CharSequence errString) ` Called when an unrecoverable error has been encountered and the operation is complete. |
| ` void` | ` https://developer.android.com/reference/android/hardware/biometrics/EmbeddedBiometricPrompt.AuthenticationCallback#onAuthenticationFailed()() ` Called when a biometric is valid but not recognized. |
| ` void` | ` https://developer.android.com/reference/android/hardware/biometrics/EmbeddedBiometricPrompt.AuthenticationCallback#onAuthenticationHelp(int,%20java.lang.CharSequence)(int helpCode, https://developer.android.com/reference/java/lang/CharSequence helpString) ` Called when a recoverable error has been encountered during authentication. |
| ` void` | ` https://developer.android.com/reference/android/hardware/biometrics/EmbeddedBiometricPrompt.AuthenticationCallback#onAuthenticationPaused()() ` Called when the authentication session has been paused. |
| ` void` | ` https://developer.android.com/reference/android/hardware/biometrics/EmbeddedBiometricPrompt.AuthenticationCallback#onAuthenticationResumed()() ` Called when the authentication session has been resumed. |
| ` void` | ` https://developer.android.com/reference/android/hardware/biometrics/EmbeddedBiometricPrompt.AuthenticationCallback#onAuthenticationSucceeded(android.hardware.biometrics.BiometricPrompt.AuthenticationResult)(https://developer.android.com/reference/android/hardware/biometrics/BiometricPrompt.AuthenticationResult result) ` Called when a biometric is recognized. |
| ` void` | ` https://developer.android.com/reference/android/hardware/biometrics/EmbeddedBiometricPrompt.AuthenticationCallback#onBackPressed()() ` Called when the user triggers a back gesture or back key press. |
| ` void` | ` https://developer.android.com/reference/android/hardware/biometrics/EmbeddedBiometricPrompt.AuthenticationCallback#onSessionStarted(long)(long sessionId) ` Called when the authentication session has started. |
| ` void` | ` https://developer.android.com/reference/android/hardware/biometrics/EmbeddedBiometricPrompt.AuthenticationCallback#onTappedOutside()() ` Called when the user taps outside the bounds of the prompt. |

### Inherited methods

From class `

https://developer.android.com/reference/java/lang/Object

` `


https://developer.android.com/reference/java/lang/Object` `
https://developer.android.com/reference/java/lang/Object#clone()()
`

Creates and returns a copy of this object.


`


boolean` `
https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj)
`

Indicates whether some other object is "equal to" this one.


`


void` `
https://developer.android.com/reference/java/lang/Object#finalize()()
`

Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.


`


final

https://developer.android.com/reference/java/lang/Class<?>` `
https://developer.android.com/reference/java/lang/Object#getClass()()
`

Returns the runtime class of this `Object`.


`


int` `
https://developer.android.com/reference/java/lang/Object#hashCode()()
`

Returns a hash code value for the object.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#notify()()
`

Wakes up a single thread that is waiting on this object's
monitor.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#notifyAll()()
`

Wakes up all threads that are waiting on this object's monitor.


`


https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/java/lang/Object#toString()()
`

Returns a string representation of the object.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos)
`

Causes the current thread to wait until it is awakened, typically
by being *notified* or *interrupted*, or until a
certain amount of real time has elapsed.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis)
`

Causes the current thread to wait until it is awakened, typically
by being *notified* or *interrupted*, or until a
certain amount of real time has elapsed.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#wait()()
`

Causes the current thread to wait until it is awakened, typically
by being *notified* or *interrupted*.


## Public constructors

### AuthenticationCallback

```
public AuthenticationCallback ()
```

<br />

<br />

## Public methods

### onAuthenticationError

Added in [version 37.2](https://developer.android.com/topic/libraries/support-library/revisions)

```
public void onAuthenticationError (int errorCode, 
                CharSequence errString)
```

Called when an unrecoverable error has been encountered and the operation is complete.
No further actions will be made on this object.

Note that when the user triggers a back gesture, `https://developer.android.com/reference/android/hardware/biometrics/EmbeddedBiometricPrompt.AuthenticationCallback#onBackPressed()` is called
instead of this method.

<br />

| Parameters ||
|---|---|
| `errorCode` | `int`: An integer from `https://developer.android.com/` identifying the error message <br /> |
| `errString` | `CharSequence`: A human-readable error string that can be shown on an UI. This value cannot be `null`. <br /> |

### onAuthenticationFailed

Added in [version 37.2](https://developer.android.com/topic/libraries/support-library/revisions)

```
public void onAuthenticationFailed ()
```

Called when a biometric is valid but not recognized.

<br />

### onAuthenticationHelp

Added in [version 37.2](https://developer.android.com/topic/libraries/support-library/revisions)

```
public void onAuthenticationHelp (int helpCode, 
                CharSequence helpString)
```

Called when a recoverable error has been encountered during authentication. The help
string is provided to give the user guidance for what went wrong, such as "Sensor dirty,
please clean it."

<br />

| Parameters ||
|---|---|
| `helpCode` | `int`: An integer from `https://developer.android.com/` or `https://developer.android.com/` corresponding to a known error message. <br /> |
| `helpString` | `CharSequence`: A human-readable string that can be shown on an UI. This value cannot be `null`. <br /> |

### onAuthenticationPaused

Added in [version 37.2](https://developer.android.com/topic/libraries/support-library/revisions)

```
public void onAuthenticationPaused ()
```

Called when the authentication session has been paused.

<br />

### onAuthenticationResumed

Added in [version 37.2](https://developer.android.com/topic/libraries/support-library/revisions)

```
public void onAuthenticationResumed ()
```

Called when the authentication session has been resumed.

<br />

### onAuthenticationSucceeded

Added in [version 37.2](https://developer.android.com/topic/libraries/support-library/revisions)

```
public void onAuthenticationSucceeded (BiometricPrompt.AuthenticationResult result)
```

Called when a biometric is recognized.

<br />

| Parameters ||
|---|---|
| `result` | `BiometricPrompt.AuthenticationResult`: An object containing authentication-related data. This value cannot be `null`. <br /> |

### onBackPressed

Added in [version 37.2](https://developer.android.com/topic/libraries/support-library/revisions)

```
public void onBackPressed ()
```

Called when the user triggers a back gesture or back key press.

Note that when a back gesture is triggered, the prompt is automatically dismissed
and the authentication session is terminated. Unlike standard `https://developer.android.com/reference/android/hardware/biometrics/BiometricPrompt`,
this callback is invoked directly instead of
`https://developer.android.com/reference/android/hardware/biometrics/EmbeddedBiometricPrompt.AuthenticationCallback#onAuthenticationError(int,%20java.lang.CharSequence)` with
`https://developer.android.com/reference/android/hardware/biometrics/BiometricPrompt#BIOMETRIC_ERROR_USER_CANCELED`.

<br />

### onSessionStarted

Added in [version 37.2](https://developer.android.com/topic/libraries/support-library/revisions)

```
public void onSessionStarted (long sessionId)
```

Called when the authentication session has started.

<br />

| Parameters ||
|---|---|
| `sessionId` | `long`: The session id for this authentication operation. <br /> |

### onTappedOutside

Added in [version 37.2](https://developer.android.com/topic/libraries/support-library/revisions)

```
public void onTappedOutside ()
```

Called when the user taps outside the bounds of the prompt.

Note that calling this method does not automatically dismiss the prompt or terminate
the authentication session. If you wish to terminate authentication, you must explicitly
cancel using the `https://developer.android.com/reference/android/os/CancellationSignal` provided when starting the
session.

<br />