---
schema_version: "1"
id: 841b1f329f4e90651c47112983583bbf156bef442252ef40744ba0efc60537f5
title: Authentication with the Service Chat SDK for Android
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/service-cloud/service-sdk-android/guides/android-authentication.md
canonical_url: https://developer.salesforce.com/docs/service/service-sdk-android/guide/android-authentication.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: fd589d249917a7dc656009b3d635d6da81fd284b1ce9bc79f263213c7c555c86
products:
  - Embedded Service Chat SDK for Android Developer Guide
  - Service Cloud Developer Content
---

# Authentication with the Service Chat SDK for Android

The Service Chat SDK provides an authentication mechanism that allows your users to access user-specific information in Service Cloud. To authenticate, implement two interfaces and provide an access token to the SDK.

**important:** The legacy chat product is scheduled for retirement on February 14, 2026, and is in maintenance mode until then. During this phase, you can continue to use chat, but we no longer recommend that you implement new chat channels. To avoid service interruptions to your customers, migrate to [Messaging for In-App and Web](https://help.salesforce.com/s/articleView?id=service.miaw_intro_landing.htm&type=5) before that date. Messaging offers many of the [chat features](https://help.salesforce.com/s/articleView?id=service.miaw_chat_vs_messaging.htm&type=5) that you love plus asynchronous conversations that can be picked back up at any time. Learn about chat retirement in [Help](https://help.salesforce.com/s/articleView?id=001790618&type=1).

- `AuthenticatedUser`

  - : [`AuthenticatedUser`](https://forcedotcom.github.io/ServiceSDK-Android/releases/common/8.0.5/api/reference/com/salesforce/android/service/common/http/AuthenticatedUser.html) contains information about the user who wants to be authenticated.

    ```java
    public interface AuthenticatedUser {
      @NonNull String getUserId ();
    }
    ```

- `AuthTokenProvider`

  - : [`AuthTokenProvider`](https://forcedotcom.github.io/ServiceSDK-Android/releases/common/8.0.5/api/reference/com/salesforce/android/service/common/http/AuthTokenProvider.html) is an interface to the system that obtains the access token. If the access token expires, the Service Chat SDK asks your implementation to refresh the token.

    ```java
    public interface AuthTokenProvider {
      @Nullable String getToken ();
      @Nullable String getTokenType ();
      boolean canRefresh ();
      void refreshToken (@NonNull ResponseSummary responseSummary);
    }
    ```

The following sequence diagram describes the basic authentication flow.

![OAuth diagram](https://developer.salesforce.com/docs/media/service-sdk/android-oauth-diagram.png '{"class": "image-xl"}')

If you're using the Salesforce Mobile SDK, you can implement these classes as wrappers to existing authentication features. See [Authenticating Using the Salesforce Mobile SDK](https://developer.salesforce.com/docs/service/service-sdk-android/guide/android-authentication-mobilesdk.md) for more information.

If you're not using the Salesforce Mobile SDK, make sure that your implementation can access whatever authorization server you're using to obtain the access token.
