--- title: Configure a custom authentication algorithm description: Generate the custom data needed to authenticate to a web service by running script. locale: en-US canonical_url: https://www.servicenow.com/docs/r/australia/platform-security/connections-and-credentials/configure-a-custom-authentication-algorithm.html release: australia product: Connections and Credentials classification: connections-and-credentials topic_type: task last_updated: "2026-03-12" reading_time_minutes: 2 breadcrumb: [Authentication Algorithms, Connections and Credentials, Access Management] --- # Configure a custom authentication algorithm Generate the custom data needed to authenticate to a web service by running script. ## Before you begin - JavaScript knowledge - REST knowledge - Target web service API knowledge - Connection, credential, and alias knowledge - Role required: Developer ## About this task Use a connection and credential alias and custom authentication based algorithm for authentication. ## Procedure 1. Navigate to **All** > **Credentials & Connections** > **Authentication Algorithms**, and click **New**. 2. On the form, fill in the fields. The database selection in the **Format** field determines which fields are available.
Field Description
Name Unique name of this algorithm.
Algorithm Outbound request type. Select **Custom Authentication**.
Description Description of what your algorithm does.
Application Scope that your application runs in.
Instance Authentication Script Script that you select from the Script Includes table. The scripts available are as follows:- RequestAuthAWSV4Signer - RequestAuthInternal - RequestAuthSampleCustomSigner - RequestAuthTwitterSigner **Note:** - To know more about the script click the information icon next to the field. The details of the script such as Name, API Name, Application, Accessible from, Script, and so on is displayed. - In case of custom authentication with Twitter, you can choose **RequestAuthTwitterSigner**, since it uses an OAuth 1.0a method of authentication. This requires informations such as **API key and secret** and **Access token and secret** that can be used to create signatures to pass in an authorization header. For more information, see [Authentication in Twitter](https://developer.twitter.com/en/docs/authentication/oauth-1-0a).
MID Authentication Script Script that you select from the MID Server Script Includes \[Discovery view\] table. The scripts available are as follows:- RequestAuthAWSV4Signer - RequestAuthInternal - RequestAuthSampleCustomSigner - RequestAuthTwitterSigner
\[Omitted image "custom-authentication-algorithm.png"\] Alt text: Twitter authentication algorithm Based on the selected scripts and authentication algorithm, the configured credentials is sent as outbound request from ServiceNow to the provider. 3. Click **Update**. 4. Navigate to **All** > **Connections & Credentials** > **Credentials**. 5. Click **New**. 6. Create Twitter Credentials with Authentication Algorithm. In this case **TwitterAuthAlgo**. 7. Specify the fields: - Name - Active - Access token - Access token secret - Consumer key - Consumer secret - Credential alias - Authentication Algorithm \[Omitted image "twitter-algorithm.png"\] Alt text: Twitter Credentials 8. Click **Update**. ## REST step with Twitter In case of Twitter, you must ensure the following spokes or credentials are available: - Access token - Access token secret - Consumer key - Consumer secret - Authentication Algorithm Action: TwitterAuthAlgo. Input REST step with Twitter as follows: - **Credentials Alias**: The alias that is created for Twitter. - **Base URL**: Base URL details from Twitter. - **HTTPS Method**: In this case it is POST method. Posting a tweet. - **Query Parameters**: **Action** as **tweet**. \[Omitted image "twitter-post.png"\] Alt text: Post Tweet You can test the action. The tweet is posted on the Twitter page.