接続の設定
コネクタのインストール 後、ServiceNow 内のデータのデータソースに接続して作成できます。
データソースの設定
データに接続するには、次の手順を実行してください:
- 接続 | To a Server で詳細をクリックします。
- ServiceNow by CData というデータソースを選択します。
- 接続に必要な情報を入力します。
- サインインをクリックします。
- 必要に応じて、データベースおよびスキーマを選択して利用可能なテーブルとビューを確認できます。
Connection Builder の使用
connector は、代表的な接続プロパティをTableau 内で直接利用できるようにします。 しかし、より高度な設定が必要な場合や接続に関するトラブルシューティングが必要な場合には、使いにくいことがあります。 connector には、Tableau の外で接続を作成してテストできる、独立したConnection Builder が付属しています。
Connection Builder にアクセスする方法は2つあります。
- Windows では、スタートメニューのCData Tableau Connector for ServiceNow フォルダの下にあるConnection Builder というショートカットを使用します。
- また、ドライバーのインストールディレクトリに移動し、lib ディレクトリで.jar ファイルを実行することによってもConnection Builder を開始できます。
Connection Builder では、接続プロパティに値を設定し、接続テストをクリックしてその動作を確認できます。 また、クリップボードにコピーボタンを使用して、接続文字列をコピーすることもできます。 この接続文字列は、Tableau 内のconnector 接続ウィンドウにあるConnection String オプションに指定できます。
Connecting to ServiceNow
Prerequisite: All connections require the URL property. (ServiceNow instance URL).
For an authenticating user to connect to ServiceNow they need at least Read permissions to access listing metadata such as:
- sys_db_object (required for all data)
- sys_dictionary (required to retrieve ServiceNow schema information)
- sys_glide_object (required for certain ServiceNow table metadata)
Use a least-privilege pattern: create a dedicated read-only role (for example, x_connector_metadata_reader) and require it on the ACLs below.
To create these ACLs, an admin must temporarily elevate their own session:
- In the user menu, click Elevate role.
- Check security_admin and click Update.
READ sys_db_object
Requires row-level and field-level permissions. To enable access to sys_db_object:
- Navigate to System Security > Access Controls (ACL).
- To create a new access control (ACL) object, select New.
- For Type, select record.
- For Operation, select read.
- For Name, select Table [sys_db_object] in the first drop-down and --None-- in the second drop-down. (Table-level read)
- In the Requires role section, double-click the Insert a new row... text box. Search for and select your custom role (for example, x_connector_metadata_reader).
- Click Submit to create the ACL object.
- Create a second ACL for field-level read on all fields of sys_db_object:
- For Type, select record.
- For Operation, select read.
- For Name, select Table [sys_db_object] in the first drop-down and * in the second drop-down (that is, sys_db_object.*).
- In the Requires role section, add the same custom role.
READ sys_dictionary
Requires row-level and field-level permissions. To enable access to sys_dictionary:
- Navigate to System Security > Access Controls (ACL).
- To create a new access control (ACL) object, select New.
- For Type, select record.
- For Operation, select read.
- For Name, select Table [sys_dictionary] in the first drop-down and --None-- in the second drop-down. (Table-level read)
- In the Requires role section, double-click the Insert a new row... text box. Search for and select your custom role (for example, x_connector_metadata_reader).
- Click Submit to create the ACL object.
- Create a second ACL for field-level read on all fields of sys_dictionary:
- For Type, select record.
- For Operation, select read.
- For Name, select Table [sys_dictionary] in the first drop-down and * in the second drop-down (that is, sys_dictionary.*).
- In the Requires role section, add the same custom role.
READ sys_glide_object
Requires row-level and field-level permissions. To enable access to sys_glide_object:
- Navigate to System Security > Access Controls (ACL).
- To create a new access control (ACL) object, select New.
- For Type, select record.
- For Operation, select read.
- For Name, select Field class [sys_glide_object] in the first drop-down and --None-- in the second drop-down. (Table-level read)
- In the Requires role section, double-click the Insert a new row... text box. Search for and select your custom role (for example, x_connector_metadata_reader).
- Click Submit to create the ACL object.
- Create a second ACL for field-level read on all fields of sys_glide_object:
- For Type, select record.
- For Operation, select read.
- For Name, select Field class [sys_glide_object] in the first drop-down and * in the second drop-down (that is, sys_glide_object.*).
- In the Requires role section, add the same custom role.
Notes:
- If your configuration enables database views (for example, using an IncludeDatabaseViews property), create the same pair of read ACLs for sys_db_view, sys_db_view_table, and sys_db_view_table_field.
- If you surface descriptions or display column names (for example, using ShowDescriptions or UseDisplayColumnNames), create the same pair of read ACLs for sys_documentation.
- The API and the UI enforce the same security. Users must pass both table-level and field-level ACLs on each target business table to read or write records. If either ACL fails, access is denied.
- Inherited tables: many application tables extend a parent (for example, incident extends task). Inherited fields are governed by the parent’s ACLs. Ensure the user’s roles satisfy ACLs on the child and any parents.
- Business tables (e.g., incident) require their own roles/ACLs; metadata ACLs alone do not grant business data access.
Final step (perform once after creating all ACLs above):
- Navigate to User Administration > Users > Select authenticating user > Roles > Edit....
- Add the custom role you required on the ACLs (for example, x_connector_metadata_reader) to the authenticating user.
Authenticating to ServiceNow
ServiceNow supports Basic authentication, authentication via the OAuth standard, authentication via the PASSWORD grant type, and authentication via an SSO provider.
Basic
To use Basic authentication, you must provide your ServiceNow User and Password.After setting the following connection properties, you are ready to connect:
- AuthScheme: BASIC.
- User: The BASIC user.
- Password: The BASIC user's password.
- URL: The base URL of the ServiceNow instance site. For example: https://MyInstance12345.service-now.com/.
- InitiateOAuth: OFF, to avoid entering the OAuth Authorization process.
OAuth
ServiceNow supports OAuth authentication for all situations where the user is not logging in via SSO and not using Basic authentication. To enable this authentication from all OAuth flows, you must set AuthScheme to OAuth, and you must create a custom OAuth application. In addition to these OAuth values, you must also specify the URL, User, and Password.The following subsections describe how to authenticate to ServiceNow from three common authentication flows. For information about how to create a custom OAuth application, see カスタムOAuth アプリケーションの作成.
For a complete list of connection string properties available in ServiceNow, see Connection.
Desktop Applications
To authenticate with the credentials for a custom OAuth application, you must get and refresh the OAuth access token. After you do that, you are ready to connect.Get and refresh the OAuth access token:
- InitiateOAuth: GETANDREFRESH. Used to automatically get and refresh the OAuthAccessToken.
- OAuthClientId: The client Id assigned when you registered your application.
- OAuthClientSecret: The client secret that was assigned when you registered your application.
- CallbackURL: The redirect URI that was defined when you registered your application.
When you connect, the connector opens ServiceNow's OAuth endpoint in your default browser. Log in and grant permissions to the application.
After you grant permissions to the application, the connector then completes the OAuth process:
- The connector obtains an access token from ServiceNow and uses it to request data.
- The OAuth values are saved in the path specified in OAuthSettingsLocation. These values persist across connections.
When the access token expires, the connector refreshes it automatically.
Automatic refresh of the OAuth access token:
To have the connector automatically refresh the OAuth access token, do the following:
- Before connecting to data for the first time, set the following connection parameters:
- InitiateOAuth: REFRESH.
- OAuthClientId: The client Id in your application settings.
- OAuthClientSecret: The client secret in your application settings.
- OAuthAccessToken: The access token returned by GetOAuthAccessToken.
- OAuthSettingsLocation: The path where you want the connector to save the OAuth values, which persist across connections.
- On subsequent data connections, set the following:
Manual refresh of the OAuth access token:
The only value needed to manually refresh the OAuth access token is the OAuth refresh token.
- To manually refresh the OAuthAccessToken after the ExpiresIn period (returned by GetOAuthAccessToken) has elapsed, call the RefreshOAuthAccessToken stored procedure.
- Set the following connection properties:
- OAuthClientId: The Client Id in your application settings.
- OAuthClientSecret: The Client Secret in your application settings.
- Call RefreshOAuthAccessToken with OAuthRefreshToken set to the OAuth refresh token returned by GetOAuthAccessToken.
- After the new tokens have been retrieved, set the OAuthAccessToken property to the value returned by RefreshOAuthAccessToken. This opens a new connection.
Store the OAuth refresh token so that you can use it to manually refresh the OAuth access token after it has expired.
Headless Machines
If you need to log in to a resource that resides on a headless machine, you must authenticate on another device that has an internet browser. You can do this in either of the following ways:
- Option 1: Obtain the OAuthVerifier value.
- Option 2: Install the connector on a machine with an internet browser and transfer the OAuth authentication values after you authenticate through the usual browser-based flow.
After you execute either Option 1 or Option 2, configure the driver to automatically refresh the access token on the headless machine.
Option 1: Obtaining and Exchanging a Verifier Code
To obtain a verifier code, you must authenticate at the OAuth authorization URL. Do the following:
-
Authenticate from the machine with an internet browser, and obtain the OAuthVerifier connection property.
Set the following properties:
- InitiateOAuth: OFF.
- OAuthClientId: The client Id assigned when you registered your application.
- OAuthClientSecret: The client secret assigned when you registered your application.
-
Call the GetOAuthAuthorizationURL stored procedure. The stored procedure returns the CallbackURL established when the custom OAuth application was registered. (See カスタムOAuth アプリケーションの作成.)
Copy this URL and paste it into a new browser tab.
-
Log in and grant permissions to the connector. The OAuth application redirects you the redirect URI, with a parameter called code appended. Note the value of this parameter; you will need it later, to configure the OAuthVerifier connection property.
-
Exchange the OAuth verifier code for OAuth refresh and access tokens. On the headless machine, set the following connection properties to obtain the OAuth authentication values:
- InitiateOAuth: REFRESH.
- OAuthVerifier: The noted verifier code (the value of the code parameter in the redirect URI).
- OAuthSettingsLocation: Persist the encrypted OAuth authentication values to the specified file.
- OAuthClientId: The client Id in your custom OAuth application settings.
- OAuthClientSecret: The client secret in the custom OAuth application settings.
-
Test the connection to generate the OAuth settings file.
-
After you re-set the following properties, you are ready to connect:
- InitiateOAuth: REFRESH.
- OAuthSettingsLocation: The file containing the encrypted OAuth authentication values. To enable the automatic refreshing of the access token, be sure that this file gives read and write permissions to the connector.
- OAuthClientId: The client Id assigned when you registered your application.
- OAuthClientSecret: The client secret assigned when you registered your application.
Option 2: Transferring OAuth Settings
Prior to connecting on a headless machine, you must install and create a connection with the driver on a device that supports an internet browser. Set the connection properties as described above in "Desktop Applications".
After completing the instructions in "Desktop Applications", the resulting authentication values are encrypted and written to the path specified by OAuthSettingsLocation. The default filename is OAuthSettings.txt.
Test the connection to generate the OAuth settings file, then copy the OAuth settings file to your headless machine.
To connect to data via the headless machine, set the following connection properties:
- InitiateOAuth: REFRESH
- OAuthSettingsLocation: The path to the OAuth settings file you copied from the machine with the browser. To enable automatic refreshing of the access token, ensure that this file gives read and write permissions to the connector.
- OAuthClientId: The client Id assigned when you registered your custom OAuth application.
- OAuthClientSecret: The client secret assigned when you registered your custom OAuth application.
PASSWORD Grant Type
ユーザーとアプリケーションの間に信頼関係がある場合、ユーザーはPASSWORD グラントタイプを使用して、デスクトップまたはWeb から認証できます。
PASSWORD グラントタイプを介して認証するには、次のプロパティを設定します。
- AuthScheme:OAuthPassword。
- InitiateOAuth:GETANDREFRESH。この設定により、OAuth 交換や、手動でのOAuthAccessToken 接続プロパティの設定の繰り返しを避けられます。
- OAuthClientId:clientId。
- OAuthClientSecret:clientSecret。
- Username:ユーザーのユーザーネーム。
- Password:ユーザーのパスワード。
- URL:ServiceNow インスタンスのサイトのベースURL。
- CallbackURL からアクセストークンを取得します。
- 古いトークンの期限が切れたときは、新しいアクセストークンを取得します。
- OAuthSettingsLocation に地理位置情報とともにOAuth 値を保存し、接続間で永続化されるようにします。
Single Sign-On Identity Providers
ServiceNow supports single sign-on (SSO) authentication through ADFS, Okta, OneLogin, and PingFederate.
ADFS
ADFS に接続するには、AuthScheme をADFS に設定し、次のプロパティを設定します。
- User:ADFS ユーザー。
- Password:ADFS ユーザーのパスワード。
- SSOLoginURL:SSO プロバイダーのログインURL。
ADFS への認証を行うには、次のSSOProperties を設定します。
- RelyingParty:ADFS サーバーのRelying Party Identifier の値。
接続文字列の例:
AuthScheme=ADFS;User=username;Password=password;SSOLoginURL='https://sts.company.com';SSOProperties='RelyingParty=https://saml.service-now.com';Url=https://MyInstance12345.service-now.com/;
Okta
Okta に接続するには、AuthScheme をOkta に設定し、次のプロパティを設定します。
- User:Okta ユーザー。
- Password:Okta ユーザーのパスワード。
- SSOLoginURL:SSO プロバイダーのログインURL。
Okta クライアントリクエストコンテキストをオーバーライドする信頼されたアプリケーションまたはプロキシを使用する場合、またはMFA を設定している場合は、Okta を使用して認証するためにSSOProperties を組み合わせて使用する必要があります。必要に応じて、以下のいずれかを設定します。
- APIToken:Okta クライアントリクエストコンテキストをオーバーライドする、信頼されたアプリケーションまたはプロキシ経由でユーザーを認証する場合、これを顧客がOkta 組織で作成したAPI Token に設定します。
- MFAType:MFA フローを設定した場合、次の対応するタイプのいずれかに設定します:OktaVerify、Email、またはSMS。
- MFAPassCode:MFA フローを設定した場合は、有効なパスコードに設定します。
これを空欄または無効な値に設定した場合、connector はユーザーのデバイスまたはE メールにワンタイムパスワードチャレンジを発行します。パスコードを受信後、取得したワンタイムパスワードをMFAPassCode 接続プロパティに設定する接続を再度開きます。 - MFARememberDevice:デフォルトはTrue です。Okta は、MFA が必要な場合にデバイスを記憶させることをサポートします。設定された認証ポリシーに従ってデバイスの記憶が許可されている場合、connector はMFA 認証の有効期間を延長するデバイストークンを送信します。MFA を記憶させない場合は、この 変数をFalse に設定してください。
接続文字列の例:
AuthScheme=Okta;SSOLoginURL='https://example.okta.com/home/appType/0bg4ivz6cJRZgCz5d6/46';User=oktaUserName;Password=oktaPassword;Url=https://MyInstance12345.service-now.com/;
OneLogin
OneLogin に接続するには、AuthScheme をOneLogin に設定し、次のプロパティを設定します。
OneLogin への認証を行うには、次のSSOProperties を設定します。
- OAuthClientId:Developers -> API Credentials -> Credential -> ClientId を選択して取得できるOAuthClientId。
- OAuthClientSecret:Developers -> API Credentials -> Credential -> ClientSecret を選択して取得できるOAuthClientSecret。
- Subdomain:SSO アプリケーションにアクセスするOneLogin ユーザーのサブドメイン。例えば、OneLogin URL がsplinkly.onelogin.com の場合、splinkly がサブドメインの値です。
- AppId:SSO アプリケーションのId。
- リージョン(オプション):OneLogin アカウントで使用しているリージョン。有効な値はUS(デフォルト)またはEU です。
次の例の接続文字列はOneLogin への接続にAPI Key を使います:
AuthScheme=OneLogin;User=OneLoginUserName;Password=OneLoginPassword;SSOProperties='OAuthClientID=3fc8394584f153ce3b7924d9cd4f686443a52b;OAuthClientSecret=ca9257fd5cc3277abb5818cea28c06fe9b3b285d73d06;Subdomain=OneLoginSubDomain;AppId=1433920';Url=https://MyInstance12345.service-now.com/;
PingFederate
PingFederate に接続するには、AuthScheme をPingFederate に設定し、次のプロパティを設定します。
- User:PingFederate ユーザー。
- Password:PingFederate ユーザーのパスワード。
- SSOLoginURL:SSO プロバイダーのログインURL。
- AWSRoleARN(オプション):複数のロールARN がある場合は、認可に使用するARN を指定します。
- AWSPrincipalARN(オプション):複数のプリンシパルARN がある場合は、認可に使用するARN を指定します。
- SSOProperties(オプション):Amazon S3へのリクエストにユーザー名とパスワードを認可ヘッダーとして含める場合は、Authscheme=Basic。
SSOLoginURL 用の相互SSL 認証(WS-Trust STS エンドポイント)を有効化するには、次の SSOProperties を設定します。
接続文字列の例:
AuthScheme=PingFederate;URL='https://dev103586.service-now.com';SSOLoginUrl='https://mycustomserver.com:9033/idp/sts.wst';User=admin;Password=PassValue123;
次のステップ
データビジュアライゼーションを作成するには、コネクタの使用 を参照してください。