> For the complete documentation index, see [llms.txt](https://docs.mogoplus.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mogoplus.ai/api-reference/authentication.md).

# Authentication

This endpoint is provided to allow Google marketplace participants to fetch their access token from MOGOPLUS by passing the required Authorization details.

{% hint style="danger" %}
The client\_id  and client\_secret, which are required to invoke the Authentication API can be generated from Mogoplus console. More information available [here](https://docs.mogoplus.ai/api-management)
{% endhint %}

## How to Authenticate?

* As mentioned above, get the client id and secret from MOGOPLUS console
* 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.dev.mogoplus.ai/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/x-www-form-urlencoded |
| Accept       | application/json                  |

**Form-data**

| Name            | Value                                                        |
| --------------- | ------------------------------------------------------------ |
| `client_id`     | {generated from user management section in Mogoplus console} |
| `client_secret` | {generated from user management section in Mogoplus console} |

**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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.mogoplus.ai/api-reference/authentication.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
