--- title: AuthCredential - Scoped description: The AuthCredential\(\) API provides methods that enable you to build credentials for a REST request.Instantiates a new AuthCredential object, or modifies an existing one.Returns the value of an AuthCredential attribute.Sets an attribute for an AuthCredential object. locale: en-US canonical_url: https://www.servicenow.com/docs/r/australia/api-reference/server-api-reference/AuthCredentialAPI.html release: australia product: Server API Reference classification: server-api-reference topic_type: concept last_updated: "2026-03-12" reading_time_minutes: 2 breadcrumb: [Server API reference, API reference, API implementation and reference] --- # AuthCredential- Scoped The AuthCredential\(\) API provides methods that enable you to build credentials for a REST request. Generate outbound signing requests using these APIs in the following order: 1. HttpRequestData: Build the API request. 2. AuthCredential: Create a credential object or update an existing one. Use the credential to sign the request through the RequestAuthAPI class. 3. RequestAuthAPI: Sign the request and return an HttpRequestAuthedData object. 4. HttpRequestAuthedData: Get information about the signed request. 5. GlideHTTPRequest: Send the signed request. Before using these APIs, you must [configure an authentication algorithm](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/platform-security/configure-authentication-algorithm.md) to sign the request and associate it with the credential used to authenticate the request. You can create an empty AuthCredential object, instantiate an existing AuthCredential object, or use the StandardCredentialsProvider class to instantiate an AuthCredential object using a Credential record from the Credentials \[discovery\_credentials\] table. If you create an empty AuthCredential object, use the setAttribute\(\) method to add properties to the object. The following example shows how to instantiate an AuthCredential using StandardCredentialsProvider: ``` // Return an AuthCredential object using a Credential sys_id var credential = new sn_cc.StandardCredentialsProvider().getAuthCredentialByID("5b61c16f73533300f662cff8faf6a74b"); ``` Use the AuthCredential API in scoped scripts with the `sn_auth` namespace identifier. **Parent Topic:**[Server API reference](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/api-server.md) ## AuthCredential - AuthCredential\(Object authCredential\) Instantiates a new AuthCredential object, or modifies an existing one. You can create an empty AuthCredential object, instantiate an existing AuthCredential object, or use the StandardCredentialsProvider class to instantiate an AuthCredential object using a Credential record from the Credentials \[discovery\_credentials\] table. If you create an empty AuthCredential object, use the setAttribute\(\) method to add properties to the object. |Name|Type|Description| |----|----|-----------| |authCredential|Object|Optional. Include this parameter to update an existing AuthCredential object.| ## AuthCredential - getAttribute\(String key\) Returns the value of an AuthCredential attribute.
| Name | Type | Description |
|---|---|---|
| key | String | Key of the attribute to return the value for. If you created an empty AuthCredential object, you must use the setAttribute\(\) method to add properties to the object. If you used a credential record to instantiate the AuthCredential object, pass a field name from the Credential \[discovery\_credentials\] table to access the value. |