Configuration for Blank Query Connection

How to Set Up Configuration

 

  1. Being signed in to your ServiceNow instance, open the Scheduled Jobs module.

Scheduled Jobs.gif

 

  1. Locate and open the Scheduled Generation based on Power BI Connector Auth record.

Scheduled Generation.gif

 

  1. Select Execute Now.

 

  1. Open the Application Registry module.

 

  1. Find and open the Power BI Connector Auth record.

 

  1. In the navigator box, enter the sys_properties.LIST, and then hit Enter.

The sys_properties.LIST will be automatically opened in a new tab.

 

  1. Find and open x_acsof_power_bi_s.x_acsoft.pbi.client_secret.

Now you should have two tabs open: Power BI Connector Auth and x_acsof_power_bi_s.x_acsoft.pbi.client_secret

 

  1. Return to the Power BI Connector Auth page, select the padlock icon, and then copy Client Secret (It will be opened after selecting the padlock icon).

 

  1. Return to the x_acsof_power_bi_s.x_acsoft.pbi.client_secret page.

  2. Paste the copied Client Secret into the Value field, and then select Update.

 

  1. Find and open x_acsof_power_bi_s.x_acsoft.pbi.client_id (on the same page - sys_properties.LIST).

 

  1. Return to the Power BI Connector Auth page, and then copy the Client ID value.

 

  1. Return to the x_acsof_power_bi_s.x_acsoft.pbi.client_id page.

  2. Paste the copied Client ID into the Value field, and then select Update.

 

  1. Return to the Power BI Connector Auth page, and then select New.

 

  1. In the *Name field, enter the preferable name for your Jwt Verifier Map, and then select Submit.

 

  1. Generate JKS and OpenSSL certificate by following these guides:

 

  1. Open newly-created Jwt Verifier Map record.

 

  1. Select Lookup using list.

 

  1. Select New.

 

  1. In the *Name field, enter your certificate name.

  2. Fill in the Format and Type fields as shown in the screenshot.

 

  1. Open the publickey.cer file using a text editor.

  1. Copy its data, paste it into the PEM Certificate field, and then select Submit.

 

  1. Open JWT Providers, and then open the pbi jwt provider record.

 

  1. Copy the Client ID (from Power BI Connector Auth), and then paste it into the Claim Value fields of the aud and iss records.

 

  1. Select the info icon of the Signing Configuration field, and then select Open Record.

 

  1. Select Lookup using list of the Signing Keystore field.

 

  1. Select New.

 

  1. In the Type field, select Java Key Store.

 

  1. In the *Name field, enter the name of your certificate.

 

  1. In the Key store password field, enter your key store password of the .jks file.

 

  1. Select the clip icon, and then select your .jks file.

 

  1. Select Submit.

 

  1. Ensure the Signing Keystore field contains the correct record, and then select Update.

 

How to Test Configuration

 

  1. Open Scripts - Background.

 

  1. Paste the following script with the created values on your instance, and then select Run script.

var jwtAPI = new sn_auth.GlideJWTAPI(); var headerJSON = { "kid": "5eff1ab1b383f9105a6ba26bf3a2cfa7" }; var header = JSON.stringify(headerJSON); var payloadJSON = { "jti": “client_id_application_registry”, "iss": "client_id_application_registry", "sub": "userEmail" }; var payload = JSON.stringify(payloadJSON); var jwtProviderSysId = "497022f18783f9106f8263973cbb35ba"; var jwt = jwtAPI.generateJWT(jwtProviderSysId, header, payload); gs.info("JWT:" + jwt);
  • “client_id_application_registry”: Application Registry → Power BI Connector Ath → Client ID

  • “userEmail“: Users (under Organization section) → find the user you need, and then copy their email

 

  • value for var jwtProviderSysId: JWT Providers → pbi jwt provider → right-click → Copy sys_id

 

 

 

  1. Open Postman, select the POST method, and then enter the following URL:

https://your_instance_name/oauth_token.do

where your_instance_name is the name of your ServiceNow instance.

  1. Select Body, select the x-www-form-urlencoded format, and then enter the following variables:

  • client_id - Application Registry → Power BI Connector Auth → Client ID

  • client_secret - Application Registry → Power BI Connector Auth → Client Secret

  • grant_type - urn:ietf:params:oauth:grant-type:jwt-bearer

  • assertion: JWT generated by the background script in the ServiceNow instance