> For the complete documentation index, see [llms.txt](https://mercuryo.gitbook.io/mobilesdk-en/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mercuryo.gitbook.io/mobilesdk-en/authentication.md).

# Authentication

SDK implies that your company is listed as partner and user already registered in Mercuryo on behalf of your company.

To authenticate user SDK must work with `SessionManager`. Main function is `updateToken` which should get token string as a parameter. It's up to your application to securely obtain token from the backend.

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

```kotlin
val mercuryo: Mercuryo = Mercuryo.create(...)  
val sessionManager: SessionManager = mercuryo.session
```

{% endtab %}

{% tab title="Swift" %}

```swift
var mercuryoSDK: IMercuryo = IMercuryo(isDebug: true, baseHost: "HOST_HERE")
var sessionManager: IosSessionManager: mercuryoSDK.session
```

{% endtab %}
{% endtabs %}

## Token update

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

```kotlin
sessionManager.updateToken(token: String)
```

{% endtab %}

{% tab title="Swift" %}

```swift
session.updateToken(token: "TOKEN")
```

{% endtab %}
{% endtabs %}
