# Authentication

{% hint style="info" %}
The client certificate and key, which are required to invoke the Authentication API will be provided by MOGOPLUS team.
{% endhint %}

## How to Authenticate?

* Get the client certificate and key from MOGOPLUS team
* Request MOGOPLUS team to provide Basic Auth info (username and password)
* Form the request as mentioned below using the above details and send
* You should receive a Bearer token in response to the request

## Login

<mark style="color:green;">`POST/`</mark>`https://auth.auuat.mogoplus.com/api/v1/oauth2/token?grant_type=client_credentials`

Invoke the API over mTLS and fetch access token from MOGOPLUS to prove the authenticity of requests

**Headers**

| Name          | Value                                |
| ------------- | ------------------------------------ |
| Content-Type  | `application/json`                   |
| Authorization | `Basic Auth <username and password>` |

**Parameters**

| Name        | Value               |
| ----------- | ------------------- |
| grant\_type | client\_credentials |

**Response**

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

```json
{
    "access_token": "eyJraWQiOiI0ZDIyZTlhMy1hNTcyMKD85Nz3kco6EHxYfTk",
    "token_type": "Bearer",
    "expires_in": 35999
}
```

{% endtab %}

{% tab title="400" %}

```json
{
    "error_description": "OAuth 2.0 Parameter: grant_type",
    "error": "unsupported_grant_type",
    "error_uri": "https://datatracker.ietf.org/doc/html/rfc6749#section-5.2"
}
```

{% endtab %}

{% tab title="401" %}

```json
{
    "error": "invalid_client"
}
```

{% 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.mogoplus.ai/mogoplus-open-banking/api-reference/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.
