Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

ConnectionJSON to servicenow using Basic Auth

jralexander137
New Contributor III
New Contributor III

Does anyone happen to have a sample connectionJson for Servicenow using basic auth they could share?

 

There is this in the doc

{
"authentications": {
"acctAuth": {
"authType": "Basic",
"url": "https://<domain name>/api/tbng4/custom_service_catalog_api/cat_item/6b8cd34c1b227300c2bf2f066e4bcbf1",
"httpMethod": "POST",
"httpHeaders": {
"content-Type": "application/json" },
"properties": {
"userName": "<user name>",
"password": "<password>" },
"httpContentType": "application/json",
"expiryError": "ExpiredAuthenticationToken",
"retryFailureStatusCode": [401],
"authError": [
"Internal server error" ],
"timeOutError": "Read timed out",
"errorPath": "message",
"maxRefreshTryCount": 5,
"tokenResponsePath": "access_token",
"tokenType": "Basic",
"accessToken": "Basic abcd" }
}
}

 

Im not sure what that provided URL is for? That doesn't look like an authentication endpoint.

5 REPLIES 5

stalluri
Regular Contributor II
Regular Contributor II

@jralexander137  Please refer to below JSON

{
"authentications": {
"acctAuth": {
"authType": "Basic",
"url": "<URL>",
"httpMethod": "POST",
"httpParams": {},
"httpHeaders": {},
"httpContentType": "text/html",
"properties": {
"userName":"<<USERNAME>>/token",
"password":"<<PASSWORD>>"
},
"expiryError": "ExpiredAuthenticationToken",
"authError": [
"InvalidAuthenticationToken",
"AuthenticationFailed"
],
"timeOutError": "Read timed out",
"testname": "<test URL>",
"errorPath": "error.code",
"maxRefreshTryCount": 5,
"tokenResponsePath": "access_token",
"tokenType": "Basic",
"accessToken": "Basic <<TOKEN>>",
"apiRateLimitConfig": {"retryAfterCalls": 100,"retryWaitSeconds": 60}
}
}
}

{
"authentications": {
"acctAuth": {
"authType": "Basic",
"url": "<URL>",
"httpMethod": "POST",
"httpParams": {},
"httpHeaders": {},
"httpContentType": "text/html",
"properties": {
"userName":"<<USERNAME>>/token",
"password":"<<PASSWORD>>"
},
"expiryError": "ExpiredAuthenticationToken",
"authError": [
"InvalidAuthenticationToken",
"AuthenticationFailed"
],
"timeOutError": "Read timed out",
"testname": "<test URL>",
"errorPath": "error.code",
"maxRefreshTryCount": 5,
"tokenResponsePath": "access_token",
"tokenType": "Basic",
"accessToken": "Basic <<TOKEN>>",
"apiRateLimitConfig": {"retryAfterCalls": 100,"retryWaitSeconds": 60}
}
}
}


Best Regards,
Sam Talluri
If you find this a helpful response, kindly consider selecting Accept As Solution and clicking on the kudos button.

What do you populate in the <<TOKEN>> for basic auth? Didnt think that was needed for basic auth?

rushikeshvartak
All-Star
All-Star

You can open any url of service now and add into URL Section

Any reason for not using oauth ?


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

Trying to get them to do OAuth, not sure why they don't at the moment.

stalluri
Regular Contributor II
Regular Contributor II

@jralexander137 

you can use the below Json.

{
"authentications":{
"acctAuth":{
"authType":"basic",
"errorPath":"error.code",
"maxRefreshTryCount":5,
"tokenResponsePath":"access_token",
"properties":{
"userName":"<Username>",
"password":"<Password>"
},
"authError":[
"InvalidAuthenticationToken",
"AuthenticationFailed"
],
"retryFailureStatusCode":[]
}
}


Best Regards,
Sam Talluri
If you find this a helpful response, kindly consider selecting Accept As Solution and clicking on the kudos button.