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.

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 before that date. Messaging offers many of the chat features that you love plus asynchronous conversations that can be picked back up at any time. Learn about chat retirement in Help.

Important

AuthenticatedUser
AuthenticatedUser contains information about the user who wants to be authenticated.
1public interface AuthenticatedUser {
2  @NonNull String getUserId ();
3}
AuthTokenProvider
AuthTokenProvider 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.
1public interface AuthTokenProvider {
2  @Nullable String getToken ();
3  @Nullable String getTokenType ();
4  boolean canRefresh ();
5  void refreshToken (@NonNull ResponseSummary responseSummary);
6}

The following sequence diagram describes the basic authentication flow.

OAuth diagram

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 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.