# Service Authentication

{% hint style="info" %}
Once the service URLs are fetched, there is no more need for further authentication and users are free to use their favourite library to enjoy the smooth experience of COSMOS integration!
{% endhint %}

## Request Service URLs

<mark style="color:blue;">`GET`</mark> `https://<user>:<password>@p20.cosmos-project.ch/urlrequest`

Respective service URLs can be retrieved using a BASIC authentication over HTTPS.

#### Path Parameters

| Name                | Type   | Description                          |
| ------------------- | ------ | ------------------------------------ |
| \<user>:\<password> | string | user and password for authentication |

{% tabs %}
{% tab title="200 JSON response containing all available services for a respective user. " %}

```javascript
{
    pathrequest:"XXXXXXXXXXXXXXXXXXX",
    boundary:"XXXXXXXXXXXXXXXXXXX",
    staterequest:"XXXXXXXXXXXXXXXXXXX",
    pathrequest_cosmos20alps:"XXXXXXXXXXXXXXXXXXX",
    cosmos500:[
        {
            "name":"exosnow_map500",
            "url":"XXXXXXXXXXXXXXXXXXX"
        }
    ],
    cosmos20:[
        {
            name:"europealps",
            url:"XXXXXXXXXXXXXXXXXXX"
        },
        {
            name:"usarockies",
            url:"XXXXXXXXXXXXXXXXXXX"
        },
        {
            name:"usasierra",
            url:"XXXXXXXXXXXXXXXXXXX"
        },
        {
            name:"centrehimalaya",
            url:"XXXXXXXXXXXXXXXXXXX"
        },
        {
            name:"westhimalaya",
            url:"XXXXXXXXXXXXXXXXXXX"
        }
    ],
    beta:[
        {
            name:"sd_usasierra",
            url:"XXXXXXXXXXXXXXXXXXX"
        },
        {
            name:"sd_usarockies",
            url:"XXXXXXXXXXXXXXXXXXX"
        
        },
        {
            name:"age_alps",
            url:"XXXXXXXXXXXXXXXXXXX"
        }
    ],
    point_sd_rockies:"XXXXXXXXXXXXXXXXXXX",
    point_sd_sierra:"XXXXXXXXXXXXXXXXXXX"
}
```

{% endtab %}
{% endtabs %}

{% hint style="danger" %}
It is expected that this request of URLs is made by the customer's backend to ExoLabs backend.&#x20;

**The customer client must never have access to the authentication credentials and should be authorized by a separate authentication between customer backend and client!**&#x20;
{% endhint %}

{% file src="/files/-MR3zsgQ2Ce2WhXeWVIN" %}
How credentials should be managed
{% endfile %}

Descriptions for the URL keys can be found here:

{% content-ref url="/pages/-MQRNR28NCoL6VxIrxT3" %}
[Service Listing](/cosmos/service-listing.md)
{% endcontent-ref %}


---

# 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://exolabs-ch.gitbook.io/cosmos/service-authentication.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.
