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

# Authentication

The MultiSet Unity SDK provides flexible authentication options to integrate with your AR applications. Authentication is required to access MultiSet services and can be configured either at design-time or runtime.

### Authentication Methods

### Default Authentication (Design-time)

By default, the SDK handles authentication automatically at the start of an AR session using credentials configured in the Unity Editor.

**Setup Steps:**

1. Open the MultiSet SDK Manager in Unity
2. Click on MultiSet Configuration
3. Enter your Client ID and Client Secret in the MultiSet Config file
4. The SDK will automatically authenticate when the AR session starts

**Advantages:**

* No code required
* Credentials are stored in the project configuration
* Authentication happens automatically

### Runtime Authentication

For more control over the authentication process, you can pass credentials at runtime and manually trigger authentication.

Select MultiSet SDK Manager and click on **Runtime Authentication**

<figure><img src="/files/W6piR66fSSkUcvVNU2lm" alt=""><figcaption></figcaption></figure>

**Implementation:**

Once you check **Runtime Authentication,** you must call `AuthenticateMultiSetSDK()` manually when needed

```csharp
public void AuthenticateSDK()
{
    // Set credentials at runtime
    multisetSdkManager.clientId = clientId;
    multisetSdkManager.clientSecret = clientSecret;

    // Validate credentials before authentication
    if (clientId != null && clientSecret != null)
    {
        // Manually trigger authentication
        multisetSdkManager.AuthenticateMultiSetSDK();
    }
    else
    {
        Debug.LogWarning("Client ID and Client Secret cannot be empty! Please enter valid credentials.");
    }
}
```

**Advantages:**

* Credentials can be loaded from external sources
* Authentication timing is fully controlled
* No automatic authentication at AR session start
* Useful for multi-environment deployments


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://multiset.gitbook.io/multiset/unity-sdk/authentication.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
