---
title: "Exchanges authentication credentials for access tokens."
method: POST
path: "/authorize_client"
tags: ["Authorization"]
---

# Exchanges authentication credentials for access tokens.

`POST /authorize_client`

## Request

- Base URL: `https://auth.viafoura.co`
- URL: `https://auth.viafoura.co/authorize_client`
- Auth: HTTP basic

OAuth 2.0 allows for the secure retrieval of resources while protecting user credentials.  Viafoura provides an authentication service which is OAuth 2.0 compliant.

To use OAuth 2.0 authentication with Viafoura, the following must occur:

1. Obtain a temporary access token by requesting authorization with our OAuth 2.0 compliant server.
2. Request a protected resource using the aforementioned access token.
3. The resource server will verify the access token before providing the resource.

The token produced is encoded as a JSON Web Token and it is **valid for 5 minutes**

If the access token has expired, an error will return when requesting the protected resource, and a new access token must be requested.

## Request body `application/x-www-form-urlencoded`

- Body
  - `grant_type` string, required: Type of access to be granted in the token. It must always be client_credentials.
  - `scope` string, uuid, required: The UUID of the site for which the access token should be generated.

## Response `200`

An object containing the provided access token, encoded as JWT.

- ClientAuthResponse
  - `access_token` string: The access token as JWT.
  - `client` string, uuid: The UUID of the client for which the token was generated.
  - `grant_type` string: The type of access granted in the token.
  - `authname` string: Name of the client for which the token was generated.
  - `status_code` integer: Service generated status code.
  - `status_message` string: Additional information about returned result.

---

[API](https://skmtc.dev/viafoura/apis/authentication-user-management-api.md) - [All operations](https://skmtc.dev/viafoura/apis/authentication-user-management-api/llms.txt) - [OpenAPI document](https://skmtc.dev/viafoura/apis/authentication-user-management-api/revisions/cefb7f5f5ef3?raw)
