> For the complete documentation index, see [llms.txt](https://docs.legal-data-analytics.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.legal-data-analytics.com/legal-data-analytics-v1/api-basics/login-authorisation.md).

# Login and Authorisation

Find most important and hands-on documentation on usage login and usage of the Apikey

## Login via MS Azure Active Directory or partner managed SSO

Once you are on-boarded you can access the front-end at <https://www.os-assist.de>

Please get more information about the on-onboarding process from LDA Legal Data Analytics team.

## API Key via Otto-Schmidt IDP

Please get in touch with Otto-Schmidt to obtain your client\_id and client\_secret to generate your access token.

### Token Retrieval

### curl

```sh
curl --location 'https://online.otto-schmidt.de/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=authorization_code' \
--data-urlencode 'client_id=YOUR_CLIENT_ID' \
--data-urlencode 'client_secret=YOUR_CLIENT_SECRET'
```

### python

```python
import requests
url = "https://online.otto-schmidt.de/token"
payload = 'grant_type=authorization_code&client_id=YOUR_CLIENT_ID&client_secret=YOUR_CLIENT_SECRET' headers = { 'Content-Type': 'application/x-www-form-urlencoded' }
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
```

## API Key via LDA IDP

Please get in touch with LDA to obtain the Tenant ID and your client\_id and client\_secret to generate your access token.

### Token Retrieval

### curl

```sh
curl --location 'https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0/token' \
--data-urlencode 'client_id={YOUR_CLIENT_ID}' \
--data-urlencode 'scope=https://graph.microsoft.com/.default' \
--data-urlencode 'client_secret={YOUR_CLIENT_SECRET}' \
--data-urlencode 'grant_type=client_credentials'
```

### python

```python
import requests

url = "https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0/token"
payload = 'client_id={YOUR_CLIENT_ID}&scope=https%3A%2F%2Fgraph.microsoft.com%2F.default&client_secret={YOUR_CLIENT_SECRET}&grant_type=client_credentials'

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
```

## Authorisation Scheme

The access\_token and APIKEY can be used to access the Legal Data Hub REST APIs

```sh
curl --location 'https://api.legal-data-hub.com/api/data-assets' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN'
```

and

```python
import http.client

conn = http.client.HTTPSConnection("​https://api.legal-data-hub.com")
payload = ''
headers = {
  'Authorization': 'Bearer YOUR_ACCESS_TOKEN'
}
conn.request("GET", "/api/data-assets", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
```

## Technical Guideline for Key Handling

See [Technical Guideline: Key Management for LDH-Compatible Applications](/legal-data-analytics-v1/integration/ldh-readiness/technical-guideline-key-management-for-ldh-compatible-applications.md)
