# MoveAuth

The [MoveAuth ](https://docs.movesdk.com/move-platform/move-sdk-1.x/sdk/models/moveauth)object is used to validate the usage of the SDK and configure its services according to that product's specifications.

{% tabs %}
{% tab title="Android" %}

```kotlin
MoveAuth {
    productID: Long
    contractId: String
    accessToken: String
    refreshToken: String    
}
```

{% endtab %}

{% tab title="iOS" %}

```swift
struct MoveAuth {
    var userToken: String
    var refreshToken: String
    var contractID: String
    var productID: Int
}
```

{% endtab %}

{% tab title="React Native" %}

```javascript
export type RnDolphinAuth = {
  productId: number,
  contractId: string,
  accessToken: string,
  refreshToken: string,
};
```

{% endtab %}
{% endtabs %}

| MoveAuth     |        |                                     |
| ------------ | ------ | ----------------------------------- |
| userToken    | String | User's session-based access token.  |
| refreshToken | String | User's session-based refresh token. |
| contractID   | String | User's contract id.                 |
| productID    | String | Client's product id.                |

{% hint style="warning" %}

### Authentication Expiry

The host app is expected to monitor [MoveAuthState](https://docs.movesdk.com/move-platform/move-sdk-1.x/sdk/models/moveauthstate) updates via`authStateChangeListener`(Android / [iOS](https://docs.movesdk.com/move-platform/move-sdk-1.x/api-interface/ios/services#set-sdk-auth-state-listener)) API and handle those changes accordingly.

Check [Authentication updates and expiry](https://docs.movesdk.com/move-platform/move-sdk-1.x/sdk/moveauthstate#authentication-updates-and-expiry) for more details.&#x20;
{% endhint %}

| MoveAuth related APIs                                                                                                                                        |                                                                                                                                           |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------- |
| `setAuthStateChangeListener()` (Android / [iOS](https://docs.movesdk.com/move-platform/move-sdk-1.x/api-interface/ios/services#set-sdk-auth-state-listener)) | Block to be invoked every time SDK [MoveAuthState](https://docs.movesdk.com/move-platform/move-sdk-1.x/sdk/models/moveauthstate) changes. |
| `getAuthState()`(Android / [iOS](https://docs.movesdk.com/move-platform/move-sdk-1.x/api-interface/ios/services#get-sdk-auth-state))                         | Gets the current [MoveAuthState](https://docs.movesdk.com/move-platform/move-sdk-1.x/sdk/models/moveauthstate).                           |
