and more in a single search tool across platforms. Read the announcement here. |
02/21/2024 02:04 PM
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:
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
02/21/2024 02:34 PM
Please share curl command [Refer https://codingnconcepts.com/postman/how-to-generate-curl-command-from-postman/ ]
02/21/2024 08:45 PM
@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.
02/21/2024 09:20 PM - edited 02/21/2024 09:20 PM
Hi @KhaoulaD ,
Please share the postman screenshot with the payload and curl command.
02/22/2024 02:29 AM
Hello,
This is the postman call throught OAuth 20
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
02/25/2024 09:32 PM
Please share curl command [Refer https://codingnconcepts.com/postman/how-to-generate-curl-command-from-postman/ ]