> ## Documentation Index
> Fetch the complete documentation index at: https://docs.abbyy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Resource Owner Password Credentials

> Use the OAuth 2.0 Resource Owner Password Credentials flow to authenticate to the ABBYY Vantage API directly with a username and password (no browser).

This authentication scheme is relatively simple and allows the application to log into the user's system without using the browser by directly processing the username and password.

If an external Identity Provider is configured for a tenant, the Resource Owner Password Credentials authentication scheme will not work.

To obtain the access token, use the following:

1. A POST request.
2. The token endpoint. If your email address is connected to several accounts in different tenants and you use this authentication, use `https://vantage-<region>.abbyy.com/auth2/{tenantId}/connect/token`. The `https://vantage-<region>.abbyy.com/auth` resource is deprecated.
3. A `Content-Type` header with the `application/x-www-form-urlencoded` encoding.
4. A request body with the following parameters:

| Parameter                                | Description                                     |
| ---------------------------------------- | ----------------------------------------------- |
| grant\_type=password                     | Specifies that the password grant type is used. |
| scope=openid permissions global.wildcard | Specifies the permission scope.                 |
| username and password                    | Your credentials.                               |
| client\_id                               | Application identifier.                         |
| client\_secret                           | Secure application key.                         |

Sample request:

For Windows:

<CodeGroup>
  ```shell US theme={null}
  curl --location --request POST "https://vantage-us.abbyy.com/auth2/connect/token" \
    --data-urlencode "grant_type=password" \
    --data-urlencode "scope=openid permissions global.wildcard" \
    --data-urlencode "username=e-mail" \
    --data-urlencode "password=password" \
    --data-urlencode "client_id=client_id" \
    --data-urlencode "client_secret=client_secret"
  ```

  ```shell EU theme={null}
  curl --location --request POST "https://vantage-eu.abbyy.com/auth2/connect/token" \
    --data-urlencode "grant_type=password" \
    --data-urlencode "scope=openid permissions global.wildcard" \
    --data-urlencode "username=e-mail" \
    --data-urlencode "password=password" \
    --data-urlencode "client_id=client_id" \
    --data-urlencode "client_secret=client_secret"
  ```

  ```shell AU theme={null}
  curl --location --request POST "https://vantage-au.abbyy.com/auth2/connect/token" \
    --data-urlencode "grant_type=password" \
    --data-urlencode "scope=openid permissions global.wildcard" \
    --data-urlencode "username=e-mail" \
    --data-urlencode "password=password" \
    --data-urlencode "client_id=client_id" \
    --data-urlencode "client_secret=client_secret"
  ```
</CodeGroup>

For Linux:

<CodeGroup>
  ```shell US theme={null}
  curl --location --request POST 'https://vantage-us.abbyy.com/auth2/connect/token' \
    --data-urlencode 'grant_type=password' \
    --data-urlencode 'scope=openid permissions global.wildcard' \
    --data-urlencode 'username=e-mail' \
    --data-urlencode 'password=password' \
    --data-urlencode 'client_id=client_id' \
    --data-urlencode 'client_secret=client_secret'
  ```

  ```shell EU theme={null}
  curl --location --request POST 'https://vantage-eu.abbyy.com/auth2/connect/token' \
    --data-urlencode 'grant_type=password' \
    --data-urlencode 'scope=openid permissions global.wildcard' \
    --data-urlencode 'username=e-mail' \
    --data-urlencode 'password=password' \
    --data-urlencode 'client_id=client_id' \
    --data-urlencode 'client_secret=client_secret'
  ```

  ```shell AU theme={null}
  curl --location --request POST 'https://vantage-au.abbyy.com/auth2/connect/token' \
    --data-urlencode 'grant_type=password' \
    --data-urlencode 'scope=openid permissions global.wildcard' \
    --data-urlencode 'username=e-mail' \
    --data-urlencode 'password=password' \
    --data-urlencode 'client_id=client_id' \
    --data-urlencode 'client_secret=client_secret'
  ```
</CodeGroup>

The server's response to your request will contain the access token:

```json theme={null}
{
  "access_token": "<redacted>",
  "expires_in": 86400,
  "token_type": "Bearer",
  "scope": "openid permissions global.wildcard"
}
```

For more information about Resource Owner Password Credentials, visit [this link](https://datatracker.ietf.org/doc/html/rfc6749#section-4.3).
