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

[ServiceNow As Ticketing System]: Not Able to autentificate through UI

KhaoulaD
New Contributor III
New Contributor III

Hello,

 

I'm trying to retrieve the token using OAuth2 authentification to authenticate to serviceNow(AskMe) i'm able to do that using postman but seems that the token is not displayed once i authenticate as shown below:

KhaoulaD_0-1708552705843.png

Also, i tried through the UI but getting the error below:

User Not Authenticated","detail":"Required to provide Auth information"

Below the connection JSON used:

{
"authentications":{
"ServiceNow":{
"authType":"oauth2",
"url":"https://domainName/v1/oauth20/token",
"httpMethod":"POST",
"httpParams":{
"grant_type":"Password Credentials",
"client_secret":",
"client_id":"",
"username":"",
"password":""
},
"httpHeaders":{
"contentType":"application/x-www-form-urlencoded"
},
"httpContentType":"application/x-www-form-urlencoded",
"expiryError":"ExpiredAuthentificationToken",
"authError":[
"InvalidAuthenticationToken"
],
"errorPath":"error.code",
"timedOutError":"Read Timed out",
"TokenResponsePath":"access_token",
"retryFailureStatusCode":[
401
],
"maxRefreshTryCount":5,
"tokenType":"Basic",
"accessToken":"Basic abcd"
}
}
}

Do you have any idea or faced this issue before?

 

Best Regards,

Khaoula DOUHI

5 REPLIES 5

rushikeshvartak
All-Star
All-Star

Please share curl command [Refer https://codingnconcepts.com/postman/how-to-generate-curl-command-from-postman/ ]


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

Manu269
All-Star
All-Star

@KhaoulaD for the same cases :

{
"authentications": {
"userAuth": {
"authType": "oauth2",
"url": "https://<domain name>/oauth_token.do",
"httpParams": {
"password": "<password>",
"grant_type": "password",
"scope": "useraccount",
"client_id": "<client id>",
"client_secret": "<client secret>",
"username": "<username>" },
"httpHeaders": {
"Content-Type": "application/x-www-form-urlencoded" },
"authError": [
"InvalidAuthenticationToken" ],
"httpMethod": "POST",
"httpContentType": "application/x-www-form-urlencoded",
"errorPath": "error.code",
"maxRefreshTryCount": 5,
"tokenResponsePath": "access_token",
"tokenType": "Bearer",
"retryFailureStatusCode": [
401
],
"accessToken": "Bearer token" }
}
}

 

We had to pass all the 4 highlghted paramters.

Regards
Manish Kumar
If the response answered your query, please Accept As Solution and Kudos
.

sai_kanumuri
Honored Contributor
Honored Contributor

Hi @KhaoulaD ,

Please share the postman screenshot with the payload and curl command.

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

KhaoulaD
New Contributor III
New Contributor III

Hello,

 

This is the postman call throught OAuth 20

KhaoulaD_0-1708597647631.png

The test connection is failing through UI with this JSON:

{
"authentications":{
"ServiceNow":{
"authType":"oauth2",
"url":"https://domainName/v1/oauth20/token",
"httpMethod":"POST",
"httpParams":{
"grant_type":"Password Credentials",
"client_secret":",
"client_id":"",
"username":"",
"password":""
},
"httpHeaders":{
"contentType":"application/x-www-form-urlencoded"
},
"httpContentType":"application/x-www-form-urlencoded",
"expiryError":"ExpiredAuthentificationToken",
"authError":[
"InvalidAuthenticationToken"
],
"errorPath":"error.code",
"timedOutError":"Read Timed out",
"TokenResponsePath":"access_token",
"retryFailureStatusCode":[
401
],
"maxRefreshTryCount":5,
"tokenType":"Basic",
"accessToken":"Basic abcd"
}
}
}

 

I passed all the parameters without success

  • Url in screenshot and JSON is different 
  • tokenResponsePath is missing

Please share curl command [Refer https://codingnconcepts.com/postman/how-to-generate-curl-command-from-postman/ ]


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