---
schema_version: "1"
id: 3c9bdda6047fdb573e79225b06436887cb1d5949e9e38b8c611f499b61f9b450
title: User Verification for Android
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/service-cloud/messaging-in-app/guides/android-user-verification.md
canonical_url: https://developer.salesforce.com/docs/service/messaging-in-app/guide/android-user-verification.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 884b52d8ec70049411391f61a1c8d6cb053a9aff558b19fd0ac5dce8ae3f55ec
products:
  - Enhanced In-App Chat
  - Service Cloud Developer Content
---
# User Verification for Android

Pass user verification information to Salesforce to ensure that your customers get the best experience with a rep.


**important:** This feature requires version 1.2.0 or later of the Enhanced In-App Chat SDK.


This article applies to the following implementations:

| UI SDK | Core SDK |
| :----: | :------: |
|   ✅   |    ✅    |


Before you can use the SDK for user verification, you must upload the appropriate keys to Salesforce. To learn about and set up User Verification, see [User Verification in Salesforce Help](https://help.salesforce.com/s/articleView?id=service.user_verification.htm).

**tip:** Avoid using the same `ConversationID` when switching deployments, as conversations from one deployment might not be accessible in the other, especially when changing between unverified and verified users.

**note:** Currently, this feature supports JWT tokens. Also, we don’t support chatting with verified users alongside unverified users. Your implementation must be designed for either verified users or unverified users.


1. When creating the `UIConfiguration` or `CoreConfiguration` object, add the optional `isUserVerificationRequired` argument and set it to `true`. See the [`CoreConfiguration`](https://salesforce-async-messaging.github.io/messaging-in-app-android/sdk/core/com.salesforce.android.smi.core/-core-configuration/index.html) reference documentation.
2. Implement the [`UserVerificationProvider`](https://salesforce-async-messaging.github.io/messaging-in-app-android/sdk/data/com.salesforce.android.smi.network.api.auth/-user-verification-provider/index.html) interface. This provider contains the `userVerificationChallenge` method, which the SDK calls when it requires user verification information.
3. Add your provider to the SDK using the `CoreClient.registerUserVerificationProvider` property. See the [`CoreClient`](https://salesforce-async-messaging.github.io/messaging-in-app-android/sdk/core/com.salesforce.android.smi.core/-core-client/index.html) reference documentation.
4. Revoke the token when the user logs out by calling `CoreClient.revokeToken`. See the [`CoreClient`](https://salesforce-async-messaging.github.io/messaging-in-app-android/sdk/core/com.salesforce.android.smi.core/-core-client/index.html) reference documentation.

**note:** This sample code requires the configuration object that you created when setting up the UI SDK or the Core SDK. See [Build a UI SDK App](https://developer.salesforce.com/docs/service/messaging-in-app/guide/android-ui-sdk.md) or [Build a Core SDK App](https://developer.salesforce.com/docs/service/messaging-in-app/guide/android-core-sdk.md) for more information.

```
// Set the user verification flag on the config object to true
val config = CoreConfiguration.fromFile(this, "configFile.json", true)

// Create a core client from a config
val coreClient = CoreClient.Factory.create(myContext, config)

// Register a provider
coreClient.registerUserVerificationProvider( object : UserVerificationProvider {

  // Implement the user verification challenge method
  override suspend fun userVerificationChallenge(reason: ChallengeReason): UserVerificationToken {

    // Get the JWT token
    val type = UserVerificationType.JWT
    val token = "{ JWT token goes here }"

    // Pass the token to the SDK
    return UserVerificationToken(type, token)
  }
})
```

After you register your provider, the SDK automatically calls the `userVerificationChallenge` method when it needs a valid token.
