# Getting Started

In order to use the IDM you have to retrieve another token for your application.
So that your application can authenticate against our IDM service. With that, we want to prevent leaking the IDM directly to the users.

Here is the current procedure how to get access to the IDM

{/* <!-- TODO: this need refinement when process how partner can ask for IDM access is done --> */}

1. On the questionnaire we ask you if and how you want to use the IDM
2. You will receive a client ID and a client secret once we register your app in our system
3. Use this client ID and client secret with the [client credentials authentication flow](../authentication/client-credentials.md) to get an IDM access token
4. Use the IDM access token to access the IDM API

If you ever notice that you need access to more scopes than you requested or if you need help in general with the IDM, always feel free to contact us.

<Alert type="info">
  Accessing the IDM can only be done from a server, and should never be done from a client device!
</Alert>

## Architecture

In order to use the IDM you have to use a server so that the IDM client ID and IDM client secret are never visible for the app that is running on the user's device. The IDM client ID and IDM client secret always stay on the server and should never be exposed to your client-side application. From there on the server requests an access token from our OAuth 2.0 Server that can be saved on the server and can be used to authenticate against the IDM service. To learn more about how to authenticate with [client credentials](/authentication/client-credentials), take a look at our guide.

The following diagram show the authentication flow with the IDM.

```mermaid
  sequenceDiagram
    title Authentication via Client Credential Flow

    participant Client as Your App
    participant Server as Your Server
    participant Auth as OAuth 2.0 Server
    participant IDM as IDM

    Server->>Auth: Request access token using client credentials <br> (IDM client ID + IDM client secret)
    Auth->>Server: Provide IDM access token

    Client->>Server: get data from IDM
    Server->>IDM: Request data using IDM access token
    IDM->>Server: Provide data

    Server->>Client: Provide data
```