This article will encompass all portalAPI calls that are related to /portalAPI/OAuth/* endpoints
If you are new to working with ThreatLocker PortalAPI endpoints and/or have questions regarding authentication and terminology used throughout this article, please look through the following guide:
Table of Contents
Token
https://portalapi.INSTANCE.threatlocker.com/portalapi/OAuth/Token
- Method: POST
- Description: This API generates a new OAuth token used for API authentication with a Bearer Token instead of an API Key. To use this API, an API User must be able to authenticate with OAuth 2.0 using valid client_id and client_secret values. For more information on creating an API User using the OAuth 2.0 authentication method, see the KB article below:
API Users | ThreatLocker Help Center
Note: Unlike other ThreatLocker PortalAPI endpoints, this API expects the fields below to be sent in a request body formatted as "x-www-form-urlencoded" instead of JSON.
- Required Body/Parameters
- Fields
- client_id: This field determines which API User's token will be generated/refreshed. Note that this ID differs from the APIUserId found in the Portal and is visible only when creating the API User or generating new OAuth credentials; it should be stored securely.
- client_secret: This field determines the API User's secret key used for authentication/token refreshing. Note that this value is visible only when creating the API User or generating new OAuth credentials; it should be stored securely.
- Expects: Text input of the client's secret key
- grant_type: This field determines the grant type of the authentication token. For ThreatLocker OAuth tokens, use the text "client_credentials".
- Expects: Text input of exactly "client_credentials"
- client_id: This field determines which API User's token will be generated/refreshed. Note that this ID differs from the APIUserId found in the Portal and is visible only when creating the API User or generating new OAuth credentials; it should be stored securely.
- Fields
Required body
client_id=<String>&client_secret=<String>
&grant_type=client_credentials
- Optional Body/Parameters
- N/A
- Permission Requirements
- N/A
Sample response body: Use the String value returned in the access_token field as the value for your Bearer Token/API Authentication
{
"access_token": "<String>",
"token_type": "Bearer",
"expires_in": <Integer>
}
Help Center