Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Passing UserName, Password and Client Secret in Connection Alias for OAuth Autentication

Chitra23
Tera Contributor

Hi,

I have a requirement to connect to PowerBI to pull reports and display in SNOW.  I have created a action with REST API call to connect to PowerBI to fetch the report URL.  I'm using OAuth Credentials and everything works fine when I provide username, password, client ID and client secret in the Request body. However, I want to pass these details in the Connection Alias itself instead of passing them in the request body. I have provided the client id and secret in the oAuth Registry while creating the connection & Credential Alias. When I remove the client Secret from the request body i'm getting  the below mentioned error. (Screenshot attached)

 

{"error":"invalid_client","error_description":"AADSTS7000218: The request body must contain the following parameter: 'client_assertion' or 'client_secret'.\r\nTrace ID: 865ea6a3-8795-4ea6-b452-5bd90b229703\r\nCorrelation ID: 8e5acb0c-424b-4385-b8e3-355c922fb4b6\r\nTimestamp: 2023-04-13 08:16:00Z","error_codes":[7000218],"timestamp":"2023-04-13 08:16:00Z","trace_id":"865ea6a3-8795-4ea6-b452-5bd90b229703","correlation_id":"8e5acb0c-424b-4385-b8e3-355c922fb4b6","error_uri":"https://login.microsoftonline.com/error?code=7000218"}

 

 

Is there a way to pass the credentials in the connection alias itself to make it secure?

1 REPLY 1

Meloper
Kilo Sage

Hi, did you manage it?