---
title: "Authenticate with a token."
slug: "authenticate-with-a-token"
updated: 2025-10-18T04:50:53Z
published: 2025-10-18T04:50:58Z
canonical: "support.fortanix.com/authenticate-with-a-token"
---

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

# Authenticate with a token.

Post/api/v1/iam/session/oauth2/token

Authenticate using the Oauth 2.0 Client Credentials flow.

To call this you must provide the form url encoded app ID and the form url encoded API key in the form of a Basic auth header.

Body parameters

Conforms to RFC 6749 Section 4.4.2.

<select class='api-response-data' aria-label='Media type'><option value='ac16aadf-0daa-4cdf-ba8f-aa71eb5ae919'>application/x-www-form-urlencoded</option>
</select>object  grant_typestring    Valid values[
  "client_credentials"
]

Responses200

Success result.

<select class='api-response-data' aria-label='Media type'><option value='b9fe6af6-f42c-47be-b7d5-3488bbfba4e3'>application/json</option>
</select>object  Example{
  "access_token": "2YotnFZFEjr1zCsicMWpAA",
  "expires_in": 3600,
  "token_type": "Bearer"
}access_tokenstring    
expires_ininteger    

Token lifetime in seconds.

token_typestring    

401

Invalid credentials.

<select class='api-response-data' aria-label='Media type'><option value='9d86c133-f0e0-4130-a431-2db0d4ad2569'>application/json</option>
</select>object  errorstring    

Conforms to RFC 6749 Section 5.2.

Valid values[
  "invalid_client",
  "invalid_grant",
  "invalid_request",
  "invalid_scope",
  "unauthorized_client",
  "unsupported_grant_type"
]
error_descriptionstring    
error_uristring
