# Auth

We do not use JWT as in the Client section to identify the administrator. We use the `username`, `password` and `API key` that we specify in the `.env` file. After the client logs in, each request will have an `API-KEY` added to the headers object.

```
ADMIN_USERNAME=Enclaive
ADMIN_PASSWORD=Qw23K#D(#ke3
API_KEY=Mn3dcrNYNXswd332GSFVeq
APP_ADMIN_URL=
```

It is important to note that in the APP\_ADMIN\_URL field you must enter the URL where the admin dashboard is located. If the request comes from a different URL, the response will be an error with status `404 Not Found`.

## Login

<mark style="color:green;">`POST`</mark> `{{BASE_URL}}/admin/api/auth/login`

Admin authentication via email and password fields.

#### Path Parameters

| Name                                 | Type   | Description |
| ------------------------------------ | ------ | ----------- |
| id<mark style="color:red;">\*</mark> | String | App ID      |

#### Request Body

| Name                                       | Type   | Description |
| ------------------------------------------ | ------ | ----------- |
| username<mark style="color:red;">\*</mark> | String |             |
| password<mark style="color:red;">\*</mark> | String |             |

{% tabs %}
{% tab title="200: OK " %}

```json
{"apiKey":"MWGCcrWxNXsvdxExcHYGGSFVRsnq"}
```

{% endtab %}
{% endtabs %}

## Get profile

<mark style="color:blue;">`GET`</mark> `{{BASE_URL}}/admin/api/auth/profile`

Get an administrator profile.

#### Headers

| Name                                      | Type   | Description   |
| ----------------------------------------- | ------ | ------------- |
| Api-Key<mark style="color:red;">\*</mark> | String | Admin api key |

{% tabs %}
{% tab title="200: OK " %}

```json
{"username":"Enclaive","role":"Admin"}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: 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:

```
GET https://docs.enclaive.cloud/enclaive-multi-cloud-platform/developers/api/admin-admin-api/auth.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
