--- title: Configure HMAC token-based authentication description: Configure HMAC to support authentication for REST API endpoints. locale: en-US canonical_url: https://www.servicenow.com/docs/r/platform-security/authentication/configure-hmac.html release: brazil product: Authentication classification: authentication topic_type: task last_updated: "2026-09-10" reading_time_minutes: 4 breadcrumb: [API key and HMAC authentication for inbound REST APIs, Token-based authentication, API authentication, Authentication, Access Management] --- # Configure HMAC token-based authentication Configure HMAC to support authentication for REST API endpoints. ## Before you begin Role required: api\_service\_admin, adaptive\_auth\_policy\_admin Plugin required: API Key and HMAC Authentication \(com.glide.tokenbased\_auth\) **Note:** While configuring the HMAC, ensure the name of the script that starts with HMAC to be populated in the script list view. ## Procedure 1. Create an HMAC configuration. 1. Navigate to **All** > **System Web Services** > **API Access Policies** > **HMAC Configuration**. 2. Select **New**. **Note:** You can also use the **Default HMAC SHA256 Base64 Encoding** which is created when installing the plugin. 3. On the form, fill in the fields:
| Field | Description |
|---|---|
| Name | Name for the HMAC configuration. |
| Application | Scope of the configuration. |
| Description | Detailed description about the configuration. |
| Hash Algorithm | The hash algorithm to use. Options available:- HmacSHA256 - HmacSHA384 - HmacSHA512 **Note:** Starting with the Yokohama release, weak hash algorithms are not supported. Use HmacSHA256 or a stronger algorithm. |
| HMAC util script | Utility script for HMAC.**Note:** If you validate HMAC authentication using Request body, Time stamp and Secret with no Key Id, then do the following: - Create a customized script include as HMAC util script - Use that script include util to interpret the passed in timestamp, and request body. For every shared secret created in the ServiceNow® instance, there is a key ID. You need to configure the key ID into Default key id in HMAC auth profile. |
| Field | Description |
|---|---|
| Name | Name to identify the authentication policy. |
| Application | Scope of the authentication policy. |
| Configuration for HMAC | The HMAC configuration that was created. |
| Auth Parameter | The auth parameter for the authentication request. You can select the default options or create a new auth parameter:- x-sn-hmac-signature-256: Auth Header - x-sn-hmac-signature-256: Query Parameter |
| Default Key ID of Shared Secret | The token information that can be updated in this field for using HMAC. |
| Field | Description |
|---|---|
| Name | Name to identify the REST API HMAC secret. |
| Description | Description for the REST API HMAC secret. |
| Active | Status of the REST API HMAC secret. |
| User | User associated to the REST API HMAC secret. Use the look-up icon to select the user. |
| Key ID | Key ID that must be sent as part of the REST call. Key ID is generated after submitting the form. |
| Shared Secret | Shared secrets of the user. For example, the password. |
| Source | Source of the record. |
| Expiry | Time after which the credential is no longer valid. Empty value means no expiration.**Note:** For more information, about expiry of token, see [Cleaning up token expiry](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/brazil/markdown/platform-security/authentication/token-expiry-api-and-hmac.md) . |
| Field | Description |
|---|---|
| Name | Unique name of the API access policy. |
| Active | Option to make the API access policy active. |
| REST API | The REST API to which the access policy is applied. For example, **Attachment API**. |
| REST API PATH | API path of the REST API. This field is auto-populated based on the selected REST API. For example, **now/attachment**. |
| HTTP Method | Method used for interacting with the API. This field is auto-populated based on the selected REST API. |
| Version | Version of the API. For example, **v1**. This field is auto-populated based on the selected REST API.**Note:** To create an authentication policy for all versions of a REST API, you must create individual policies for each version. |
| Resource | Child resource of the REST API. This field is auto-populated based on the selected REST API. For example, **/now/attachment** |
| Application | Scope of the application. |
| Global | Option to apply auth policy to all methods, versions, and resources for the API.**Note:** Token Based Auth isn’t allowed in the Global REST API Policy. |
| Apply to all methods | Option to apply the auth policy for the API to all the methods, versions, and resources for the API. |
| Apply to all resources | Option to apply the auth policy for the API to all the versions. |
| Apply to all versions | Option to apply the auth policy for the API to all the resources. |