
## Set Client State Change listener
---
Set your own ClientStateChangeListener to get optional callbacks.
**Method name:**  
Client.setOnClientStateChangeListener(listener);
  
**Declaration:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-774">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-774-0" data-tab-group="tabgrp-774" data-tab-active="true">Java</button><button class="tab-button" data-tab-id="tabgrp-774-1" data-tab-group="tabgrp-774">Kotlin</button></div>

<div class="tab-panel" data-tab-id="tabgrp-774-0" data-tab-group="tabgrp-774" data-tab-active="true">

```Java
public static void setOnClientStateChangeListener(OnClientStateChangeListener listener)
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-774-1" data-tab-group="tabgrp-774">

```Kotlin
fun setOnClientStateChangeListener(listener:OnClientStateChangeListener)
```

</div>
</div>


**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **listener** | OnClientStateChangeListener | yes | - | interface to handle client state change |


**Return Value:**  
No value is returned.

**Example:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-775">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-775-0" data-tab-group="tabgrp-775" data-tab-active="true">Java</button><button class="tab-button" data-tab-id="tabgrp-775-1" data-tab-group="tabgrp-775">Kotlin</button></div>

<div class="tab-panel" data-tab-id="tabgrp-775-0" data-tab-group="tabgrp-775" data-tab-active="true">

```Java
Client.setOnClientStateChangeListener(listener);
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-775-1" data-tab-group="tabgrp-775">

```Kotlin
Client.setOnClientStateChangeListener(listener)
```

</div>
</div>


## Remove Client State Change listener
---
Remove your own ClientStateChangeListener.
**Method name:**  
Client.removeClientStateChangeListener();
  
**Declaration:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-776">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-776-0" data-tab-group="tabgrp-776" data-tab-active="true">Java</button><button class="tab-button" data-tab-id="tabgrp-776-1" data-tab-group="tabgrp-776">Kotlin</button></div>

<div class="tab-panel" data-tab-id="tabgrp-776-0" data-tab-group="tabgrp-776" data-tab-active="true">

```Java
public static void removeClientStateChangeListener()
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-776-1" data-tab-group="tabgrp-776">

```Kotlin
fun removeClientStateChangeListener()
```

</div>
</div>


**Parameters:**  
No parameters required.


**Return Value:**  
No value is returned.

**Example:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-777">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-777-0" data-tab-group="tabgrp-777" data-tab-active="true">Java</button><button class="tab-button" data-tab-id="tabgrp-777-1" data-tab-group="tabgrp-777">Kotlin</button></div>

<div class="tab-panel" data-tab-id="tabgrp-777-0" data-tab-group="tabgrp-777" data-tab-active="true">

```Java
Client.removeClientStateChangeListener();
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-777-1" data-tab-group="tabgrp-777">

```Kotlin
Client.removeClientStateChangeListener()
```

</div>
</div>


## Register customer account
---
This method registers a new customer with an email, password, and optional data.
  
This method requires the context object with a customer’s email, password, and optional data. Omitted fields are not modified.
  
Depending on the backend configuration, the account may require activation. For details, see  [customer registration](/developers/mobile-sdk/user-identification-and-authorization/overview).
  
Do not allow signing in again (or signing up) when a customer is already signed in. Sign the customer out first.
  
Do not create multiple instances nor call this method multiple times before execution.
  
This method is a global operation and doesn't require customer authentication.


<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

The API key must have the `SAUTH_REGISTER_CLIENT_CREATE` permission from the **Client** group.

</div></div></div>

**Method name:**  
Client.registerAccount(registerClient)
  
**Declaration:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-778">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-778-0" data-tab-group="tabgrp-778" data-tab-active="true">Java</button><button class="tab-button" data-tab-id="tabgrp-778-1" data-tab-group="tabgrp-778">Kotlin</button></div>

<div class="tab-panel" data-tab-id="tabgrp-778-0" data-tab-group="tabgrp-778" data-tab-active="true">

```Java
public static IApiCall registerAccount(@NonNull RegisterClient registerClient)
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-778-1" data-tab-group="tabgrp-778">

```Kotlin
fun registerAccount(registerClient: RegisterClient): IApiCall
```

</div>
</div>


**Parameters:**  
| Parameter | Type | Mandatory | Default |
| --- | --- | --- | --- |
| **registerClient** | [RegisterClient](/developers/mobile-sdk/class-reference/android/client#registerclient) | yes | - |

**Return Value:**  
[IApiCall](/developers/mobile-sdk/method-reference/android/public-interfaces#iapicall) object to execute the request.

**Example:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-779">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-779-0" data-tab-group="tabgrp-779" data-tab-active="true">Java</button><button class="tab-button" data-tab-id="tabgrp-779-1" data-tab-group="tabgrp-779">Kotlin</button></div>

<div class="tab-panel" data-tab-id="tabgrp-779-0" data-tab-group="tabgrp-779" data-tab-active="true">

```Java
private IApiCall signUpCall;
private void signUp(RegisterClient registerClient) {
        if (signUpCall != null) signUpCall.cancel();
        signUpCall = Client.registerAccount(registerClient);
        signUpCall.onSubscribe(() -> toggleLoading(true))
                  .doFinally(() -> toggleLoading(false))
                  .execute(this::onSignUpSuccessful, this::onSignUpFailure);
    }
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-779-1" data-tab-group="tabgrp-779">

```Kotlin
private var signUpCall: IApiCall
    private fun signUp(registerClient: RegisterClient) {
        signUpCall!!.cancel()
        signUpCall = Client.registerAccount(registerClient)
        signUpCall!!.onSubscribe({ toggleLoading(true) })
            .doFinally({ toggleLoading(false) })
            .execute(({ this.onSignUpSuccessful() }), ({ this.onSignUpFailure() }))
    }
```

</div>
</div>


## Request customer account activation
---
This method requests sending an email with a URL that confirms the registration and activates the account.
  
This method is a global operation and doesn't require customer authentication.


<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

The API key must have the `SAUTH_CONFIRMATION_CLIENT_CREATE` permission from the **Client** group.

</div></div></div>

**Method name:**  
Client.requestAccountActivation(email)
  
**Declaration:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-780">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-780-0" data-tab-group="tabgrp-780" data-tab-active="true">java</button><button class="tab-button" data-tab-id="tabgrp-780-1" data-tab-group="tabgrp-780">kotlin</button></div>

<div class="tab-panel" data-tab-id="tabgrp-780-0" data-tab-group="tabgrp-780" data-tab-active="true">

```java
public static IApiCall requestAccountActivation(String email)
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-780-1" data-tab-group="tabgrp-780">

```kotlin
fun requestAccountActivation(email: String): IApiCall
```

</div>
</div>

  
**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **email** | String | yes | - |Customer's email|
  
**Return Value:**  
[IApiCall](/developers/mobile-sdk/method-reference/android/public-interfaces#iapicall) object to execute the request.
  
**Example:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-781">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-781-0" data-tab-group="tabgrp-781" data-tab-active="true">java</button><button class="tab-button" data-tab-id="tabgrp-781-1" data-tab-group="tabgrp-781">kotlin</button></div>

<div class="tab-panel" data-tab-id="tabgrp-781-0" data-tab-group="tabgrp-781" data-tab-active="true">

```java
private IApiCall call;
if (call != null) call.cancel();
            call = Client.requestAccountActivation(email);
            call.execute(this::onSuccess, this::onError);
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-781-1" data-tab-group="tabgrp-781">

```kotlin
private val call: IApiCall? = null
            call.cancel();
            call = Client.requestAccountActivation(email);
            call.execute(this::onSuccess, this::onError);
```

</div>
</div>


## Confirm customer account activation
---
This method confirms a customer account with the confirmation token.
  
This method is a global operation and doesn't require customer authentication.


<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

Returns the HTTP 400 status code if the account is already confirmed or 404 if the account does not exist.

</div></div></div>



<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

The API key must have the `SAUTH_CONFIRMATION_CLIENT_CREATE` permission from the **Client** group.

</div></div></div>

**Method name:**  
Client.confirmAccountActivation(token)
  
**Declaration:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-782">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-782-0" data-tab-group="tabgrp-782" data-tab-active="true">java</button><button class="tab-button" data-tab-id="tabgrp-782-1" data-tab-group="tabgrp-782">kotlin</button></div>

<div class="tab-panel" data-tab-id="tabgrp-782-0" data-tab-group="tabgrp-782" data-tab-active="true">

```java
public static IApiCall confirmAccountActivation(String token)
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-782-1" data-tab-group="tabgrp-782">

```kotlin
fun confirmAccountActivation(token: String): IApiCall
```

</div>
</div>



**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **token** | String | yes | - | Customer's token |

**Return Value:**  
[IApiCall](/developers/mobile-sdk/method-reference/android/public-interfaces#iapicall) object to execute the request.

**Example:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-783">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-783-0" data-tab-group="tabgrp-783" data-tab-active="true">java</button><button class="tab-button" data-tab-id="tabgrp-783-1" data-tab-group="tabgrp-783">kotlin</button></div>

<div class="tab-panel" data-tab-id="tabgrp-783-0" data-tab-group="tabgrp-783" data-tab-active="true">

```java
private IApiCall call;
if (call != null) call.cancel();
            call = Client.confirmAccountActivation(token);
            call.execute(this::onSuccess, this::onError);
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-783-1" data-tab-group="tabgrp-783">

```kotlin
private val call: IApiCall? = null
            call.cancel();
            call = Client.confirmAccountActivation(token);
            call.execute(this::onSuccess, this::onError);
```

</div>
</div>


## Request customer account activation by pin
---
This method requests a customer's account registration process with the PIN code.
  
This method is a global operation and doesn't require customer authentication.


<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

The API key must have the `SAUTH_PIN_CODE_RESEND_CLIENT_CREATE` permission from the **Client** group.

</div></div></div>

**Method name:**  
Client.requestAccountActivationByPin(email)
  
**Declaration:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-784">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-784-0" data-tab-group="tabgrp-784" data-tab-active="true">Java</button><button class="tab-button" data-tab-id="tabgrp-784-1" data-tab-group="tabgrp-784">Kotlin</button></div>

<div class="tab-panel" data-tab-id="tabgrp-784-0" data-tab-group="tabgrp-784" data-tab-active="true">

```Java
public static IApiCall requestAccountActivationByPin(String email)
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-784-1" data-tab-group="tabgrp-784">

```Kotlin
fun requestAccountActivationByPin(email:String):IApiCall
```

</div>
</div>


**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **email** | String | yes | - | Email to which the pinCode will be sent |

**Return Value:**  
[IApiCall](/developers/mobile-sdk/method-reference/android/public-interfaces#iapicall) object to execute the request.

**Example:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-785">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-785-0" data-tab-group="tabgrp-785" data-tab-active="true">Java</button><button class="tab-button" data-tab-id="tabgrp-785-1" data-tab-group="tabgrp-785">Kotlin</button></div>

<div class="tab-panel" data-tab-id="tabgrp-785-0" data-tab-group="tabgrp-785" data-tab-active="true">

```Java
IApiCall apiCall;
apiCall = Client.requestAccountActivationByPin(email);
apiCall.execute(this::onSuccess, this::onFailure);
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-785-1" data-tab-group="tabgrp-785">

```Kotlin
val apiCall:IApiCall
apiCall = Client.requestAccountActivationByPin(email)
apiCall.execute(({ this.onSuccess() }), ({ this.onFailure() }))
```

</div>
</div>


## Confirm customer account activation by pin
---
This method confirms a customer's account registration process with the PIN code.
  
This method is a global operation and doesn't require customer authentication.
  

<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

The API key must have the `SAUTH_PIN_CODE_RESEND_CLIENT_CREATE` permission from the **Client** group.

</div></div></div>

**Method name:**  
Client.confirmAccountActivationByPin(pinCode, email)
  
**Declaration:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-786">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-786-0" data-tab-group="tabgrp-786" data-tab-active="true">Java</button><button class="tab-button" data-tab-id="tabgrp-786-1" data-tab-group="tabgrp-786">Kotlin</button></div>

<div class="tab-panel" data-tab-id="tabgrp-786-0" data-tab-group="tabgrp-786" data-tab-active="true">

```Java
public static IApiCall confirmAccountActivationByPin(String pinCode, String email)
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-786-1" data-tab-group="tabgrp-786">

```Kotlin
fun confirmAccountActivationByPin(pinCode: String, email:String):IApiCall
```

</div>
</div>


**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **pinCode** | String | yes | - | Code sent to the customer's email |
| **email** | String | yes | - | Email used in the registration process |

**Return Value:**  
[IApiCall](/developers/mobile-sdk/method-reference/android/public-interfaces#iapicall) object to execute the request.

**Example:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-787">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-787-0" data-tab-group="tabgrp-787" data-tab-active="true">Java</button><button class="tab-button" data-tab-id="tabgrp-787-1" data-tab-group="tabgrp-787">Kotlin</button></div>

<div class="tab-panel" data-tab-id="tabgrp-787-0" data-tab-group="tabgrp-787" data-tab-active="true">

```Java
IApiCall apiCall;
apiCall = Client.confirmAccountActivationByPin(pinCode, email);
apiCall.execute(this::onSuccess, this::onFailure);
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-787-1" data-tab-group="tabgrp-787">

```Kotlin
val apiCall:IApiCall
apiCall = Client.confirmAccountActivationByPin(pinCode, email)
apiCall.execute(({ this.onSuccess() }), ({ this.onFailure() }))
```

</div>
</div>


## Sign in a customer
---
This method signs a customer in to obtain a JSON Web Token (JWT) which can be used in subsequent requests.
  
The SDK will refresh the token before each call if it is about to expire (but not expired).
  
Do NOT allow signing in again (or signing up) when a customer is already signed in. First, sign the customer out.
  
Do NOT create multiple instances nor call this method multiple times before execution.
**Method name:**  
Client.signIn(email, password)
  
**Declaration:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-788">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-788-0" data-tab-group="tabgrp-788" data-tab-active="true">Java</button><button class="tab-button" data-tab-id="tabgrp-788-1" data-tab-group="tabgrp-788">Kotlin</button></div>

<div class="tab-panel" data-tab-id="tabgrp-788-0" data-tab-group="tabgrp-788" data-tab-active="true">

```Java
public static IApiCall signIn(@NonNull String email, @NonNull String password)
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-788-1" data-tab-group="tabgrp-788">

```Kotlin
fun signIn(email: String, password: String): IApiCall
```

</div>
</div>


**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **email** | String | yes | - | Customer's email |
| **password** | String | yes | - | Customer's password |

**Return Value:**  
[IApiCall](/developers/mobile-sdk/method-reference/android/public-interfaces#iapicall) object to execute the request.

**Example:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-789">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-789-0" data-tab-group="tabgrp-789" data-tab-active="true">Java</button><button class="tab-button" data-tab-id="tabgrp-789-1" data-tab-group="tabgrp-789">Kotlin</button></div>

<div class="tab-panel" data-tab-id="tabgrp-789-0" data-tab-group="tabgrp-789" data-tab-active="true">

```Java
private IApiCall signInCall;
private void signIn(String login, String password) {
        if (signInCall != null) signInCall.cancel();
        signInCall = Client.signIn(login, password);
        signInCall.onSubscribe(() -> toggleLoading(true))
                  .execute(() -> onSignInSuccessful(login), () -> onSignInFailure());
    }
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-789-1" data-tab-group="tabgrp-789">

```Kotlin
private var signInCall: IApiCall
    private fun signIn(login: String, password: String) {
        signInCall!!.cancel()
        signInCall = Client.signIn(login, password)
        signInCall!!.onSubscribe({ toggleLoading(true) })
            .execute({ onSignInSuccessful(login) }, { onSignInFailure() })
    }
```

</div>
</div>


## Sign in a customer conditionally
---
This method signs a customer in to obtain a JSON Web Token (JWT) which can be used in subsequent requests.
  
The SDK will refresh the token before each call if it is about to expire (but not expired).
  
Do NOT allow signing in again (or signing up) when a customer is already signed in. First, sign the customer out.
  
Do NOT create multiple instances nor call this method multiple times before execution.
  
| | **iOS SDK** | **Android SDK** | **React Native SDK** | **Flutter SDK** |
| --- | --- | --- | --- | --- |
| <span style="color:green">Introduced in:</span> | 3.7.6 | 3.8.0 | 0.9.19 | n/a |
**Method name:**  
Client.signInConditionally(email, password)
  
**Declaration:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-790">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-790-0" data-tab-group="tabgrp-790" data-tab-active="true">java</button><button class="tab-button" data-tab-id="tabgrp-790-1" data-tab-group="tabgrp-790">kotlin</button></div>

<div class="tab-panel" data-tab-id="tabgrp-790-0" data-tab-group="tabgrp-790" data-tab-active="true">

```java
public static IDataApiCall<AuthConditions> signInConditionally(@NonNull String email, @NonNull String password)
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-790-1" data-tab-group="tabgrp-790">

```kotlin
fun signInConditionally(
        email: String,
        password: String,
        ): IDataApiCall<AuthConditions>
```

</div>
</div>


**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **email** | String | yes | - | Client's email |
| **password** | String | yes | - | Client's password |

**Return Value:**  
IDataApiCall<[AuthConditions](/developers/mobile-sdk/class-reference/android/client#authconditions)> object to execute the request.

**Example:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-791">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-791-0" data-tab-group="tabgrp-791" data-tab-active="true">java</button><button class="tab-button" data-tab-id="tabgrp-791-1" data-tab-group="tabgrp-791">kotlin</button></div>

<div class="tab-panel" data-tab-id="tabgrp-791-0" data-tab-group="tabgrp-791" data-tab-active="true">

```java
private IDataApiCall<AuthConditions> call;
if (call != null) call.cancel();
            call = Client.signInConditionally(email, password));
            call.execute(this::onSuccess, this::onFailure);
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-791-1" data-tab-group="tabgrp-791">

```kotlin
val call:IDataApiCall<AuthConditions>
call.cancel()
call = Client.signInConditionally(email, password)
call.execute(({ this.onSuccess() }), ({ this.onFailure() }))
```

</div>
</div>


## Authenticate customer by IdentityProvider
---
This method authenticates a customer with OAuth, Facebook, Google, Apple, or Synerise.
  
If an account for the customer does not exist and the identity provider is different than Synerise, this request creates an account.
  
| | **iOS SDK** | **Android SDK** | **React Native SDK** | **Flutter SDK** |
| --- | --- | --- | --- | --- |
| <span style="color:green">Introduced in:</span> | 3.7.6 | 3.8.0 | 0.9.19 | 0.3.0 |
**Method name:**  
Client.authenticate(token, clientIdentityProvider, agreements, attributes, authId)
  
**Declaration:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-792">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-792-0" data-tab-group="tabgrp-792" data-tab-active="true">java</button><button class="tab-button" data-tab-id="tabgrp-792-1" data-tab-group="tabgrp-792">kotlin</button></div>

<div class="tab-panel" data-tab-id="tabgrp-792-0" data-tab-group="tabgrp-792" data-tab-active="true">

```java
public static IApiCall authenticate(String token, ClientIdentityProvider provider, Agreements agreements, Attributes attributes, String authId)
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-792-1" data-tab-group="tabgrp-792">

```kotlin
fun authenticate(
        token: String,
        provider: ClientIdentityProvider,
        agreements: Agreements?,
        attributes: Attributes?,
        authId: String?
    ): IApiCall
```

</div>
</div>


**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **token** | String | yes | - | Token retrieved from provider |
| **provider** | [ClientIdentityProvider](/developers/mobile-sdk/class-reference/android/client#clientidentityprovider) | yes | - | Provider of your token |
| **agreements** | [Agreements](/developers/mobile-sdk/class-reference/android/client#agreements) | no | - | Optional agreements |
| **attributes** | [Attributes](/developers/mobile-sdk/class-reference/android/client#attributes) | no | - | Optional attributes |
| **authId** | String | no | - | Optional identifier of authorization |
  

<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

**authId** parameter is used for decreasing the number of UUID refreshes, so it must be unique for every customer.

</div></div></div>


**Return Value:**  
[IApiCall](/developers/mobile-sdk/method-reference/android/public-interfaces#iapicall) object to execute the request.

**Example:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-793">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-793-0" data-tab-group="tabgrp-793" data-tab-active="true">java</button><button class="tab-button" data-tab-id="tabgrp-793-1" data-tab-group="tabgrp-793">kotlin</button></div>

<div class="tab-panel" data-tab-id="tabgrp-793-0" data-tab-group="tabgrp-793" data-tab-active="true">

```java
private IApiCall call;
if (call != null) call.cancel();
            call = Client.authenticate(token, provider, null, null, null);
            call.execute(this::onSuccess, this::onFailure);
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-793-1" data-tab-group="tabgrp-793">

```kotlin
val call:IApiCall
call.cancel()
call = Client.authenticate(token, provider, null, null, null)
call.execute(({ this.onSuccess() }), ({ this.onFailure() }))
```

</div>
</div>


## Authenticate customer conditionally by IdentityProvider
---
This method authenticates a customer with OAuth, Facebook, Google, Apple, or Synerise.
  
| | **iOS SDK** | **Android SDK** | **React Native SDK** | **Flutter SDK** |
| --- | --- | --- | --- | --- |
| <span style="color:green">Introduced in:</span> | 3.7.6 | 3.8.0 | 0.9.19 | n/a |
**Method name:**  
Client.authenticateConditionally(token, clientIdentityProvider, agreements, attributes, authId)
  
**Declaration:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-794">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-794-0" data-tab-group="tabgrp-794" data-tab-active="true">java</button><button class="tab-button" data-tab-id="tabgrp-794-1" data-tab-group="tabgrp-794">kotlin</button></div>

<div class="tab-panel" data-tab-id="tabgrp-794-0" data-tab-group="tabgrp-794" data-tab-active="true">

```java
public static IDataApiCall<AuthConditions> authenticateConditionally(@NonNull String token, @NonNull ClientIdentityProvider provider, @Nullable Agreements agreements, @Nullable Attributes attributes, @Nullable String authId)
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-794-1" data-tab-group="tabgrp-794">

```kotlin
fun authenticateConditionally(
        token: String,
        provider: ClientIdentityProvider,
        agreements: Agreements?,
        attributes: Attributes?,
        authId: String?
        ): IDataApiCall
```

</div>
</div>


**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **token** | String | yes | - | Token retrieved from provider |
| **provider** | [ClientIdentityProvider](/developers/mobile-sdk/class-reference/android/client#clientidentityprovider) | yes | - | Provider of your token |
| **agreements** | [Agreements](/developers/mobile-sdk/class-reference/android/client#agreements) | no | - | Optional agreements |
| **attributes** | [Attributes](/developers/mobile-sdk/class-reference/android/client#attributes) | no | - | Optional attributes |
| **authId** | String | no | - | Optional identifier of authorization |
  

<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

**authId** parameter is used for decreasing the number of UUID refreshes, so it must be unique for every customer.

</div></div></div>


**Return Value:**  
IDataApiCall<[AuthConditions](/developers/mobile-sdk/class-reference/android/client#authconditions)> object to execute the request.

**Example:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-795">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-795-0" data-tab-group="tabgrp-795" data-tab-active="true">java</button><button class="tab-button" data-tab-id="tabgrp-795-1" data-tab-group="tabgrp-795">kotlin</button></div>

<div class="tab-panel" data-tab-id="tabgrp-795-0" data-tab-group="tabgrp-795" data-tab-active="true">

```java
private IDataApiCall<AuthConditions> call;
if (call != null) call.cancel();
            call = Client.authenticateConditionally(token, clientIdentityProvider, agreements, attributes, authId));
            call.execute(this::onSuccess, this::onFailure);
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-795-1" data-tab-group="tabgrp-795">

```kotlin
val call:IDataApiCall<AuthConditions>
call.cancel()
call = Client.authenticateConditionally(token, clientIdentityProvider, agreements, attributes, authId)
call.execute(({ this.onSuccess() }), ({ this.onFailure() }))
```

</div>
</div>


## Authenticate customer with token payload
---
This method signs in a customer in with the provided token payload.
  
| | **iOS SDK** | **Android SDK** | **React Native SDK** | **Flutter SDK** |
| --- | --- | --- | --- | --- |
| <span style="color:green">Introduced in:</span> | 4.15.0 | 5.15.0 | n/a | n/a |
**Method name:**  
Client.authenticateWithTokenPayload()
  
**Declaration:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-796">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-796-0" data-tab-group="tabgrp-796" data-tab-active="true">Java</button><button class="tab-button" data-tab-id="tabgrp-796-1" data-tab-group="tabgrp-796">Kotlin</button></div>

<div class="tab-panel" data-tab-id="tabgrp-796-0" data-tab-group="tabgrp-796" data-tab-active="true">

```Java
public static IApiCall authenticateWithTokenPayload(TokenPayload tokenPayload, @NonNull String authId)
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-796-1" data-tab-group="tabgrp-796">

```Kotlin
fun authenticateWithTokenPayload(
        tokenPayload: TokenPayload,
        authId: String
        ): IApiCall
```

</div>
</div>


**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **tokenPayload** | [TokenPayload](/developers/mobile-sdk/class-reference/android/client#tokenpayload) | yes | - | Object which contains a token's payload |
| **authId** | String | yes | - | Required customer's identifier of authorization |


<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

**authId** parameter is used for decreasion the number of UUID refreshes so it must be unique for every customer.

</div></div></div>


**Return Value:**  
[IApiCall](/developers/mobile-sdk/method-reference/android/public-interfaces#iapicall) object to execute the request.

**Example:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-797">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-797-0" data-tab-group="tabgrp-797" data-tab-active="true">java</button><button class="tab-button" data-tab-id="tabgrp-797-1" data-tab-group="tabgrp-797">kotlin</button></div>

<div class="tab-panel" data-tab-id="tabgrp-797-0" data-tab-group="tabgrp-797" data-tab-active="true">

```java
private IApiCall call;
if (call != null) call.cancel();
            call = Client.authenticateWithTokenPayload(tokenPayload, authId);
            call.execute(this::onSuccess, this::onFailure);
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-797-1" data-tab-group="tabgrp-797">

```kotlin
val call:IApiCall
call.cancel()
call = Client.authenticateWithTokenPayload(tokenPayload, authId)
call.execute(({ this.onSuccess() }), ({ this.onFailure() }))
```

</div>
</div>


## Authenticate customer via Simple Profile Authentication
---
This method authenticates a customer with Simple Profile Authentication.
  
| | **iOS SDK** | **Android SDK** | **React Native SDK** | **Flutter SDK** |
| --- | --- | --- | --- | --- |
| <span style="color:green">Introduced in:</span> | 4.14.0 | 5.7.1 | 0.15.0 | 0.7.0 |
  

<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

When you use this method, you must set a request validation salt by using the `Synerise.setRequestValidationSalt(_:)` method (if salt is enabled for Simple Profile Authentication).

</div></div></div>



<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

The API key must have the `SAUTH_SIMPLE_AUTH_CREATE` from the **Auth** group.

</div></div></div>

**Method name:**  
Client.simpleAuthentication(clientData, authId)
  
**Declaration:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-798">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-798-0" data-tab-group="tabgrp-798" data-tab-active="true">java</button><button class="tab-button" data-tab-id="tabgrp-798-1" data-tab-group="tabgrp-798">kotlin</button></div>

<div class="tab-panel" data-tab-id="tabgrp-798-0" data-tab-group="tabgrp-798" data-tab-active="true">

```java
public static IApiCall simpleAuthentication(ClientData clientData, String authId)
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-798-1" data-tab-group="tabgrp-798">

```kotlin
fun simpleAuthentication(
        clientData: ClientData,
        authId: String
    ): IApiCall
```

</div>
</div>


**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **clientData** | [ClientData](/developers/mobile-sdk/class-reference/android/client#clientdata) | yes | - | Object which contains customer data |
| **authId** | String | yes | - | Required identifier of authorization |
  

<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

**authId** parameter is used for decreasing the number of UUID refreshes, so it must be unique for every customer.

</div></div></div>


**Return Value:**  
[IApiCall](/developers/mobile-sdk/method-reference/android/public-interfaces#iapicall) object to execute the request.

## Check if a customer is signed in (via RaaS, OAuth, Facebook, Apple)
---
This method checks if a customer is signed in (via Synerise Authentication - RaaS, OAuth, Facebook, Apple).
**Method name:**  
Client.isSignedIn()
  
**Declaration:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-799">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-799-0" data-tab-group="tabgrp-799" data-tab-active="true">Java</button><button class="tab-button" data-tab-id="tabgrp-799-1" data-tab-group="tabgrp-799">Kotlin</button></div>

<div class="tab-panel" data-tab-id="tabgrp-799-0" data-tab-group="tabgrp-799" data-tab-active="true">

```Java
public static boolean isSignedIn()
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-799-1" data-tab-group="tabgrp-799">

```Kotlin
fun isSignedIn():Boolean
```

</div>
</div>


**Parameters:**  
No parameters.

**Return Value:**  
Boolean defining whether a customer is signed in or not.

**Example:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-800">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-800-0" data-tab-group="tabgrp-800" data-tab-active="true">Java</button><button class="tab-button" data-tab-id="tabgrp-800-1" data-tab-group="tabgrp-800">Kotlin</button></div>

<div class="tab-panel" data-tab-id="tabgrp-800-0" data-tab-group="tabgrp-800" data-tab-active="true">

```Java
boolean isSignedIn = Client.isSignedIn()
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-800-1" data-tab-group="tabgrp-800">

```Kotlin
var isSignedIn = Client.isSignedIn()
```

</div>
</div>


## Check if a customer is signed in (via Simple Profile Authentication)
---
This method checks if a customer is signed in (via Simple Profile Authentication).
  
| | **iOS SDK** | **Android SDK** | **React Native SDK** | **Flutter SDK** |
| --- | --- | --- | --- | --- |
| <span style="color:green">Introduced in:</span> | 4.14.0 | 5.7.1 | 0.15.0 | 0.7.0 |
**Method name:**  
Client.isSignedIn()
  
**Declaration:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-801">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-801-0" data-tab-group="tabgrp-801" data-tab-active="true">Java</button><button class="tab-button" data-tab-id="tabgrp-801-1" data-tab-group="tabgrp-801">Kotlin</button></div>

<div class="tab-panel" data-tab-id="tabgrp-801-0" data-tab-group="tabgrp-801" data-tab-active="true">

```Java
public static boolean isSignedInViaSimpleAuthentication()
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-801-1" data-tab-group="tabgrp-801">

```Kotlin
fun isSignedInViaSimpleAuthentication():Boolean
```

</div>
</div>


**Parameters:**  
No parameters.

**Return Value:**  
**true** if the customer is signed in (via Simple Profile Authentication), otherwise returns **false**.

**Example:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-802">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-802-0" data-tab-group="tabgrp-802" data-tab-active="true">Java</button><button class="tab-button" data-tab-id="tabgrp-802-1" data-tab-group="tabgrp-802">Kotlin</button></div>

<div class="tab-panel" data-tab-id="tabgrp-802-0" data-tab-group="tabgrp-802" data-tab-active="true">

```Java
boolean isSignedInViaSimpleAuthentication = Client.isSignedInViaSimpleAuthentication()
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-802-1" data-tab-group="tabgrp-802">

```Kotlin
var isSignedInViaSimpleAuthentication = Client.isSignedInViaSimpleAuthentication()
```

</div>
</div>


## Sign out customer
---
This method signs out a customer out.
  

<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

This method works with every authentication type (via Synerise, External Provider, OAuth or Simple Profile Authentication).

</div></div></div>

**Method name:**  
Client.signOut()
  
**Declaration:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-803">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-803-0" data-tab-group="tabgrp-803" data-tab-active="true">Java</button><button class="tab-button" data-tab-id="tabgrp-803-1" data-tab-group="tabgrp-803">Kotlin</button></div>

<div class="tab-panel" data-tab-id="tabgrp-803-0" data-tab-group="tabgrp-803" data-tab-active="true">

```Java
public static void signOut()
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-803-1" data-tab-group="tabgrp-803">

```Kotlin
fun signOut()
```

</div>
</div>


**Parameters:**  
No parameters.

**Return Value:**  
Nothing is returned.

**Example:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-804">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-804-0" data-tab-group="tabgrp-804" data-tab-active="true">Java</button><button class="tab-button" data-tab-id="tabgrp-804-1" data-tab-group="tabgrp-804">Kotlin</button></div>

<div class="tab-panel" data-tab-id="tabgrp-804-0" data-tab-group="tabgrp-804" data-tab-active="true">

```Java
Client.signOut();
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-804-1" data-tab-group="tabgrp-804">

```Kotlin
Client.signOut();
```

</div>
</div>


## Sign out customer with mode or from all devices
---
This method signs out a customer out with a chosen mode and Determines if the method should sign out all devices.

Available modes:
- `.signOut` mode signs out the customer.
- `.signOutWithSessionDestroy` mode signs out the customer and additionally, clears the anonymous session and regenerates the customer UUID.

The `fromAllDevices` parameter determines whether the method should notify the backend to sign out all devices.

**IMPORTANT: It is an asynchronous method.**
  
| | **iOS SDK** | **Android SDK** | **React Native SDK** | **Flutter SDK** |
| --- | --- | --- | --- | --- |
| <span style="color:green">Introduced in:</span> | 4.11.0 | 5.1.0 | 0.14.0 | 1.0.0 |


<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

This method works with every authentication type (via Synerise, External Provider, OAuth or Simple Profile Authentication).

</div></div></div>

**Class:**  
[Client](/developers/mobile-sdk/class-reference/android/modules#client)
  
**Declaration:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-805">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-805-0" data-tab-group="tabgrp-805" data-tab-active="true">java</button><button class="tab-button" data-tab-id="tabgrp-805-1" data-tab-group="tabgrp-805">kotlin</button></div>

<div class="tab-panel" data-tab-id="tabgrp-805-0" data-tab-group="tabgrp-805" data-tab-active="true">

```java
public static IApiCall signOut(ClientSignOutMode mode, Boolean signOutFromAllDevices)
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-805-1" data-tab-group="tabgrp-805">

```kotlin
fun signOut(mode: ClientSignOutMode, signOutFromAllDevices: Boolean): IApiCall
```

</div>
</div>


**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **mode** | [ClientSignOutMode](/developers/mobile-sdk/class-reference/android/client#clientsignoutmode) | yes | - | Client sign out mode |
| **signOutFromAllDevices** | Boolean | yes | - | Determines if the method should sign out all devices |

**Return Value:**  
Nothing is returned.

**Example:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-806">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-806-0" data-tab-group="tabgrp-806" data-tab-active="true">java</button><button class="tab-button" data-tab-id="tabgrp-806-1" data-tab-group="tabgrp-806">kotlin</button></div>

<div class="tab-panel" data-tab-id="tabgrp-806-0" data-tab-group="tabgrp-806" data-tab-active="true">

```java
private IApiCall signOutCall;
private void signOut() {
  if (signOutCall != null) signOutCall.cancel();
  signOutCall = Client.signOut(ClientSignOutMode.SIGN_OUT_WITH_SESSION_CLEARING, true);
  signOutCall.onSubscribe(() -> toggleLoading(true))
             .execute(() -> onSignOutSuccessful(login), () -> onSignOutFailure());
}
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-806-1" data-tab-group="tabgrp-806">

```kotlin
private var signOutCall: IApiCall
private fun signOut(login: String, password: String) {
  signOutCall!!.cancel()
  signOutCall = Client.signOut(.SIGN_OUT_WITH_SESSION_CLEARING, true)
  signOutCall!!.onSubscribe({ toggleLoading(true) })
              .execute({ onSignOutSuccessful(login) }, { onSignOutFailure() })
}
```

</div>
</div>


## Removed methods

### <del>Authenticate customer by OAuth with registration</del> {#authenticate-customer-by-oauth-with-registration}
---
This method authenticates a customer with OAuth.
  
If an account for the customer does not exist, this request creates an account.
  
| Available on | **iOS SDK** | **Android SDK** | **React Native SDK** | **Flutter SDK** |
| --- | --- | --- | --- | --- |
| <span style="color:green">Introduced in:</span> | 3.6.11 | 3.6.13 | 0.9.12 | n/a |
| <span style="color:orange">Deprecated in:</span> | 3.7.6 | 3.8.0 | 0.9.19 | n/a |
| <span style="color:red">Removed in:</span> | 5.0.0 | 6.0.0 | 1.0.0 | n/a |


<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

Returns the HTTP 401 status code if the provided access token and/or API Key is invalid.

</div></div></div>

**Method name:**  
Client.authenticateByOAuth(accessToken, agreements, attributes, authId)
  
**Declaration:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-807">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-807-0" data-tab-group="tabgrp-807" data-tab-active="true">java</button><button class="tab-button" data-tab-id="tabgrp-807-1" data-tab-group="tabgrp-807">kotlin</button></div>

<div class="tab-panel" data-tab-id="tabgrp-807-0" data-tab-group="tabgrp-807" data-tab-active="true">

```java
public static IApiCall authenticateByOAuth(@NonNull String accessToken, @Nullable Agreements agreements, @Nullable Attributes attributes, @Nullable String authId)
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-807-1" data-tab-group="tabgrp-807">

```kotlin
fun authenticateByOAuth(
        accessToken: String,
        agreements: Agreements?,
        attributes: Attributes?,
        authId: String?
    ): IApiCall
```

</div>
</div>


**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **accessToken** | String | yes | - | OAuth Access Token |
| **agreements** | [Agreements](/developers/mobile-sdk/class-reference/android/client#agreements) | no | --- | Optional agreements |
| **attributes** | [Attributes](/developers/mobile-sdk/class-reference/android/client#attributes) | no | --- | Optional attributes |
| **authId** | String | no | --- | Optional identifier of authorization |
  

<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

**authId** parameter is used for decreasing the number of UUID refreshes, so it must be unique for every customer.

</div></div></div>


**Return Value:**  
[IApiCall](/developers/mobile-sdk/method-reference/android/public-interfaces#iapicall) object to execute the request.

**Example:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-808">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-808-0" data-tab-group="tabgrp-808" data-tab-active="true">java</button><button class="tab-button" data-tab-id="tabgrp-808-1" data-tab-group="tabgrp-808">kotlin</button></div>

<div class="tab-panel" data-tab-id="tabgrp-808-0" data-tab-group="tabgrp-808" data-tab-active="true">

```java
private IApiCall call;
if (call != null) call.cancel();
            call = Client.authenticateByOAuth(token, null, null, null);
            call.execute(this::onSuccess, this::onFailure);
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-808-1" data-tab-group="tabgrp-808">

```kotlin
val call:IApiCall
call.cancel()
call = Client.authenticateByOAuth(token, null, null, null)
call.execute(({ this.onSuccess() }), ({ this.onFailure() }))
```

</div>
</div>


### <del>Authenticate customer by OAuth without registration</del> {#authenticate-customer-by-oauth-without-registration}
---
This method authenticates a customer with OAuth.
  
| Available on | **iOS SDK** | **Android SDK** | **React Native SDK** | **Flutter SDK** |
| --- | --- | --- | --- | --- |
| <span style="color:green">Introduced in:</span> | 3.6.11 | 3.6.13 | 0.9.12 | n/a |
| <span style="color:orange">Deprecated in:</span> | 3.7.6 | 3.8.0 | 0.9.19 | n/a |
| <span style="color:red">Removed in:</span> | 5.0.0 | 6.0.0 | 1.0.0 | n/a |


<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

Returns the HTTP 401 status code if the provided access token and/or API Key is invalid.

</div></div></div>

**Method name:**  
Client.authenticateByOAuthIfRegistered(accessToken, authId)
  
**Declaration:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-809">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-809-0" data-tab-group="tabgrp-809" data-tab-active="true">java</button><button class="tab-button" data-tab-id="tabgrp-809-1" data-tab-group="tabgrp-809">kotlin</button></div>

<div class="tab-panel" data-tab-id="tabgrp-809-0" data-tab-group="tabgrp-809" data-tab-active="true">

```java
public static IApiCall authenticateByOAuthIfRegistered(@NonNull String accessToken, @Nullable String authId)
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-809-1" data-tab-group="tabgrp-809">

```kotlin
fun authenticateByOAuthIfRegistered(
        accessToken: String,
        authId: String?
    ): IApiCall
```

</div>
</div>


**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **accessToken** | String | yes | - | OAuth Access Token |
| **authId** | String | no | --- | Optional identifier of authorization |
  

<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

**authId** parameter is used for decreasing the number of UUID refreshes, so it must be unique for every customer.

</div></div></div>


**Return Value:**  
[IApiCall](/developers/mobile-sdk/method-reference/android/public-interfaces#iapicall) object to execute the request.

**Example:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-810">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-810-0" data-tab-group="tabgrp-810" data-tab-active="true">java</button><button class="tab-button" data-tab-id="tabgrp-810-1" data-tab-group="tabgrp-810">kotlin</button></div>

<div class="tab-panel" data-tab-id="tabgrp-810-0" data-tab-group="tabgrp-810" data-tab-active="true">

```java
private IApiCall call;
if (call != null) call.cancel();
            call = Client.authenticateByOAuthIfRegistered(token, null);
            call.execute(this::onSuccess, this::onFailure);
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-810-1" data-tab-group="tabgrp-810">

```kotlin
val call:IApiCall
call.cancel()
call = Client.authenticateByOAuthIfRegistered(token, null)
call.execute(({ this.onSuccess() }), ({ this.onFailure() }))
```

</div>
</div>


### <del>Authenticate customer by Facebook with registration</del> {#authenticate-customer-by-facebook-with-registration}
---
This method authenticates a customer with Facebook.
  
If an account for the customer does not exist, this request creates an account.
  
| | **iOS SDK** | **Android SDK** | **React Native SDK** | **Flutter SDK** |
| --- | --- | --- | --- | --- |
| <span style="color:green">Introduced in:</span> | 3.3.8 | 3.3.0 | 0.9.7 | n/a |
| <span style="color:orange">Deprecated in:</span> | 3.7.6 | 3.8.0 | 0.9.19 | n/a |
| <span style="color:red">Removed in:</span> | 5.0.0 | 6.0.0 | 1.0.0 | n/a |


<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

Returns the HTTP 401 status code if the provided Facebook token and/or API Key is invalid.

</div></div></div>

**Method name:**  
Client.authenticateByFacebook(facebookToken, agreements, attributes, authId)
  
**Declaration:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-811">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-811-0" data-tab-group="tabgrp-811" data-tab-active="true">java</button><button class="tab-button" data-tab-id="tabgrp-811-1" data-tab-group="tabgrp-811">kotlin</button></div>

<div class="tab-panel" data-tab-id="tabgrp-811-0" data-tab-group="tabgrp-811" data-tab-active="true">

```java
public static IApiCall authenticateByFacebook(@NonNull String facebookToken, @Nullable Agreements agreements, @Nullable Attributes attributes, @Nullable String authId)
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-811-1" data-tab-group="tabgrp-811">

```kotlin
fun authenticateByFacebook(
        facebookToken: String,
        agreements: Agreements?,
        attributes: Attributes?,
        authId: String?
    ): IApiCall
```

</div>
</div>


**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **facebookToken** | String | yes | - | Facebook Access Token |
| **agreements** | [Agreements](/developers/mobile-sdk/class-reference/android/client#agreements)| no | --- | Marketing agreements |
| **attributes** | [Attributes](/developers/mobile-sdk/class-reference/android/client#attributes) | no | --- | Additional attributes |
| **authId** | String | no | --- | Optional identifier of authorization |
  

<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

**authId** parameter is used for decreasing the number of UUID refreshes, so it must be unique for every customer.

</div></div></div>


**Return Value:**  
[IApiCall](/developers/mobile-sdk/method-reference/android/public-interfaces#iapicall) object to execute the request.

**Example:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-812">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-812-0" data-tab-group="tabgrp-812" data-tab-active="true">Java</button><button class="tab-button" data-tab-id="tabgrp-812-1" data-tab-group="tabgrp-812">Kotlin</button></div>

<div class="tab-panel" data-tab-id="tabgrp-812-0" data-tab-group="tabgrp-812" data-tab-active="true">

```Java
private IApiCall signInFacebookCall;
private void signInFacebook(String facebookToken) {
        if (signInFacebookCall != null) signInFacebookCall.cancel();
        signInFacebookCall = Client.authenticateByFacebook(facebookToken, null, null, null);
        signInFacebookCall.onSubscribe(() -> toggleFacebookLoading(true))
                          .execute(this::onSignInFacebookSuccess, this::onSignInFacebookError);
    }
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-812-1" data-tab-group="tabgrp-812">

```Kotlin
private var signInFacebookCall: IApiCall? = null
    private fun signInFacebook(facebookToken: String) {
        if (signInFacebookCall != null) signInFacebookCall!!.cancel()
        signInFacebookCall = Client.authenticateByFacebook(facebookToken, null, null, null)
        signInFacebookCall!!.onSubscribe({ toggleFacebookLoading(true) })
            .execute(({ this.onSignInFacebookSuccess() }), ({ this.onSignInFacebookError() }))
    }
```

</div>
</div>


### <del>Authenticate customer by Facebook without registration</del> {#authenticate-customer-by-facebook-without-registration}
---
This method authenticates a customer with Facebook.
  
| | **iOS SDK** | **Android SDK** | **React Native SDK** | **Flutter SDK** |
| --- | --- | --- | --- | --- |
| <span style="color:green">Introduced in:</span> | 3.3.8 | 3.3.0 | 0.9.7 | n/a |
| <span style="color:orange">Deprecated in:</span> | 3.7.6 | 3.8.0 | 0.9.19 | n/a |
| <span style="color:red">Removed in:</span> | 5.0.0 | 6.0.0 | 1.0.0 | n/a |


<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

Returns the HTTP 401 status code if the provided Facebook token and/or API Key is invalid.

</div></div></div>

**Method name:**  
Client.authenticateByFacebookRegistered(facebookToken, authId)
  
**Declaration:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-813">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-813-0" data-tab-group="tabgrp-813" data-tab-active="true">java</button><button class="tab-button" data-tab-id="tabgrp-813-1" data-tab-group="tabgrp-813">kotlin</button></div>

<div class="tab-panel" data-tab-id="tabgrp-813-0" data-tab-group="tabgrp-813" data-tab-active="true">

```java
public static IApiCall authenticateByFacebookRegistered(@NonNull String facebookToken, @Nullable String authId)
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-813-1" data-tab-group="tabgrp-813">

```kotlin
fun authenticateByFacebookRegistered(facebookToken: String, authId: String?): IApiCall
```

</div>
</div>


**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **facebookToken** | String | yes | - | Facebook Access Token|
| **authId** | String | no | --- | Optional identifier of authorization |
  

<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

**authId** parameter is used for decreasing the number of UUID refreshes, so it must be unique for every customer.

</div></div></div>


**Return Value:**  
[IApiCall](/developers/mobile-sdk/method-reference/android/public-interfaces#iapicall) object to execute the request.

**Example:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-814">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-814-0" data-tab-group="tabgrp-814" data-tab-active="true">java</button><button class="tab-button" data-tab-id="tabgrp-814-1" data-tab-group="tabgrp-814">kotlin</button></div>

<div class="tab-panel" data-tab-id="tabgrp-814-0" data-tab-group="tabgrp-814" data-tab-active="true">

```java
private IApiCall signInFacebookRegisteredCall;
private void signInFacebookRegistered(String facebookToken) {
        if (signInFacebookRegisteredCall != null) signInFacebookRegisteredCall.cancel();
        signInFacebookRegisteredCall = Client.authenticateByFacebookRegistered(facebookToken, null);
        signInFacebookRegisteredCall.onSubscribe(() -> toggleFacebookLoading(true))
                          .execute(this::onSignInFacebookSuccess, this::onSignInFacebookError);
    }
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-814-1" data-tab-group="tabgrp-814">

```kotlin
private var signInFacebookRegisteredCall: IApiCall? = null
    private fun signInFacebook(facebookToken: String) {
        signInFacebookRegisteredCall!!.cancel()
        signInFacebookRegisteredCall = Client.authenticateByFacebookRegistered(facebookToken, null)
        signInFacebookRegisteredCall!!.onSubscribe({ toggleFacebookLoading(true) })
            .execute(({ this.onSignInFacebookSuccess() }), ({ this.onSignInFacebookError() }))
    }
```

</div>
</div>


### <del>Sign out customer with mode</del> {#sign-out-customer-with-mode}
---
This method signs out a customer out with a chosen mode:
- `.signOut` mode notifies the backend that the customer is signed out.
- `.signOutWithSessionDestroy` mode notifies the backend that the customer is signed out and additionally, clears the anonymous session and regenerates the customer UUID.
  
| | **iOS SDK** | **Android SDK** | **React Native SDK** | **Flutter SDK** |
| --- | --- | --- | --- | --- |
| <span style="color:green">Introduced in:</span> | 4.4.0 | 4.6.0 | 0.12.0 | 0.7.0 |
| <span style="color:orange">Deprecated in:</span> | 4.11.0 | 5.1.0 | - | - |
| <span style="color:red">Removed in:</span> | 5.0.0 | 6.0.0 | 0.14.0 | 1.0.0 |


<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

This method works with every authentication type (via Synerise, External Provider, OAuth or Simple Profile Authentication).

</div></div></div>

**Class:**  
[Client](/developers/mobile-sdk/class-reference/android/modules#client)
  
**Declaration:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-815">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-815-0" data-tab-group="tabgrp-815" data-tab-active="true">java</button><button class="tab-button" data-tab-id="tabgrp-815-1" data-tab-group="tabgrp-815">kotlin</button></div>

<div class="tab-panel" data-tab-id="tabgrp-815-0" data-tab-group="tabgrp-815" data-tab-active="true">

```java
public static void signOut(ClientSignOutMode mode)
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-815-1" data-tab-group="tabgrp-815">

```kotlin
fun signOut()
```

</div>
</div>


**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **mode** | [ClientSignOutMode](/developers/mobile-sdk/class-reference/android/client#clientsignoutmode) | yes | - | Client sign out mode |

**Return Value:**  
Nothing is returned.

**Example:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-816">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-816-0" data-tab-group="tabgrp-816" data-tab-active="true">Java</button><button class="tab-button" data-tab-id="tabgrp-816-1" data-tab-group="tabgrp-816">Kotlin</button></div>

<div class="tab-panel" data-tab-id="tabgrp-816-0" data-tab-group="tabgrp-816" data-tab-active="true">

```Java
Client.signOut(mode);
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-816-1" data-tab-group="tabgrp-816">

```Kotlin
Client.signOut(mode);
```

</div>
</div>



 