> For the complete documentation index, see [llms.txt](https://docs.movesdk.com/move-platform/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.movesdk.com/move-platform/~/changes/1lLi1pFRKkteajbXv0hC/sdk/models/moveauthstate.md).

# MoveAuthState

MOVE Models

Returns the current MOVE SDK Authentication State.

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

```kotlin
enum class MoveAuthState {
    UNKNOWN,
    VALID,
    EXPIRED(MoveAuth)
}
```

{% endtab %}

{% tab title="iOS" %}

```swift
enum MoveAuthState {
    case unknown
    case expired
    case valid
}
```

{% endtab %}

{% tab title="React Native" %}

```javascript
export type AuthState = 'UNKNOWN' | 'VALID' | 'EXPIRED';
```

{% endtab %}
{% endtabs %}

| MoveAuthState                                                                             |                                                                                                                                    |
| ----------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| expired([MoveAuth](/move-platform/~/changes/1lLi1pFRKkteajbXv0hC/sdk/models/moveauth.md)) | Latest [MoveAuth](/move-platform/~/changes/1lLi1pFRKkteajbXv0hC/sdk/models/moveauth.md) expired and the MOVE SDK can't refresh it. |
| valid                                                                                     | Authentication is valid.                                                                                                           |
| unknown                                                                                   | The SDK authorization state when MOVE SDK is uninitialized.                                                                        |

### Authentication updates and expiry

[MoveAuth](/move-platform/~/changes/1lLi1pFRKkteajbXv0hC/sdk/models/moveauth.md) is session-based, hence it expires and requires to be renewed. For simplicity, the MOVE SDK handles refreshing the token for the host app whenever it expires and passes the new MoveAuth when updated via `authStateUpdateListener` API callback.

In case the SDK fails to refresh authentication, it will trigger [MoveAuthState](/move-platform/~/changes/1lLi1pFRKkteajbXv0hC/sdk/models/moveauthstate.md)`.expired`. The host app is expected to fetch a new token with the project API Key and then call `update(auth: MoveAuth)`([Android](/move-platform/~/changes/1lLi1pFRKkteajbXv0hC/sdk/api-interface/android-1/android.md#update-authentication) / [iOS](/move-platform/~/changes/1lLi1pFRKkteajbXv0hC/sdk/api-interface/ios/services.md#update-authentication)) API.

{% hint style="warning" %}

#### Authentication Updates

The host app is responsible for monitoring [MoveAuthState](/move-platform/~/changes/1lLi1pFRKkteajbXv0hC/sdk/models/moveauthstate.md) updates and handling its state updates by:

* `.expired`: Requesting new Auth using the project API Key and then passing it to the SDK using [`update(auth: MoveAuth)`](/move-platform/~/changes/1lLi1pFRKkteajbXv0hC/sdk/api-interface/ios/services.md#update-authentication) API.
* `.valid`: The SDK has accepted a new app auth via update(auth: MoveAuth) or updated its internal user token.
  {% endhint %}

| MoveAuthState related APIs                                                                                                              |                                                                                                                                    |
| --------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| `getSDKAuthState` (Android / [iOS](/move-platform/~/changes/1lLi1pFRKkteajbXv0hC/sdk/api-interface/ios/services.md#get-sdk-auth-state)) | Gets the current [MoveAuthState](/move-platform/~/changes/1lLi1pFRKkteajbXv0hC/sdk/models/moveauth.md).                            |
| `authStateUpdateListener`                                                                                                               | Block to be invoked every time [MoveAuthState](/move-platform/~/changes/1lLi1pFRKkteajbXv0hC/sdk/models/moveauthstate.md) changes. |
