Skip to content

ServiceNow 凭据#

¥ServiceNow credentials

你可以使用以下凭据验证以下节点:

¥You can use these credentials to authenticate the following nodes:

先决条件#

¥Prerequisites

创建 ServiceNow 开发者账户。

¥Create a ServiceNow developer account.

支持的身份验证方法#

¥Supported authentication methods

  • 基本身份验证

¥Basic auth

  • OAuth2

相关资源#

¥Related resources

有关服务的更多信息,请参阅 ServiceNow API 文档

¥Refer to ServiceNow's API documentation for more information about the service.

使用基本身份验证#

¥Using basic auth

要配置此凭据,你需要:

¥To configure this credential, you'll need:

  • 用户名:请输入你的 ServiceNow 用户名。

¥A User name: Enter your ServiceNow username.

  • 密码:请输入你的 ServiceNow 密码。

¥A Password: Enter your ServiceNow password.

  • 子域名:ServiceNow 实例的子域名位于实例 URL 中:https://<subdomain>.service-now.com/。例如,如果完整 URL 为 https://dev99890.service-now.com,则子域名为 dev99890

¥A Subdomain: The subdomain for your servicenow instance is in your instance URL: https://<subdomain>.service-now.com/. For example, if the full URL is https://dev99890.service-now.com, then the subdomain is dev99890.

使用 OAuth2#

¥Using OAuth2

要配置此凭据,你需要:

¥To configure this credential, you'll need:

  • 客户端 ID:注册新应用时生成。

¥A Client ID: Generated once you register a new app.

  • 客户端密钥:注册新应用时生成。

¥A Client Secret: Generated once you register a new app.

  • 子域名:ServiceNow 实例的子域名位于实例 URL 中:https://<subdomain>.service-now.com/。例如,如果完整 URL 为 https://dev99890.service-now.com,则子域名为 dev99890

¥A Subdomain: The subdomain for your servicenow instance is in your instance URL: https://<subdomain>.service-now.com/. For example, if the full URL is https://dev99890.service-now.com, then the subdomain is dev99890.

生成客户端 ID 和客户端密钥:在“系统 OAuth”>“应用注册表”>“新建”>“为外部客户端创建 OAuth API 端点”中注册一个新应用。使用以下设置配置你的应用:

¥To generate your Client ID and Client Secret, register a new app in System OAuth > Application Registry > New > Create an OAuth API endpoint for external clients. Use these settings for your app:

  • 复制客户端 ID 并将其添加到你的 n8n 凭据中。

¥Copy the Client ID and add it to your n8n credential.

  • 输入客户密钥,或留空以自动生成随机密钥。将此密钥添加到你的 n8n 凭据中。

¥Enter a Client Secret or leave it blank to automatically generate a random secret. Add this secret to your n8n credential.

  • 复制 n8n OAuth 重定向 URL,并将其添加为重定向 URL。

¥Copy the n8n OAuth Redirect URL and add it as a Redirect URL.

有关更多信息,请参阅 如何为 RESTMessageV2 集成设置 OAuth2 身份验证

¥Refer to How to setup OAuth2 authentication for RESTMessageV2 integrations for more information.