and more in a single search tool across platforms. Read the announcement here. |
01/01/2024 08:15 PM - last edited on 01/01/2024 09:58 PM by Sunil
Hi Team,
In create ticket json am getting an error "unable creation access token" because I have rest connection with token in response headers. I have followed the rest connector doc and tried the below format but am getting an error "unable creation access token".
"tokenResponsePath": "#HEADERS#Authentication-Token",
Logs :
DEBUG services.HttpClientUtilityService - got response for api..."
"ecm-worker","2024-01-02T03:46:27.836+00:00","2024-01-02T03:46:27.816009379Z stdout F 2024-01-02 03:46:27,815 [quartzScheduler_Worker-9] DEBUG rest.RestUtilService - Got showLogs = true"
"ecm-worker","2024-01-02T03:46:27.836+00:00","2024-01-02T03:46:27.816049279Z stdout F 2024-01-02 03:46:27,815 [quartzScheduler_Worker-9] DEBUG rest.RestProvisioningService - Got Webservice API Response: [headers:[X-Frame-Options: DENY, Strict-Transport-Security: max-age=31536000; includeSubDomains, Cache-Control: no-store, X-Content-Type-Options: nosniff, Content-Security-Policy: script-src 'self' 'unsafe-inline' 'unsafe-eval' https://*, Pragma: no-cache, X-XSS-Protection: 1; mode=block, Set-Cookie: JSESSIONID=****; Path=/baocdp; Secure; HttpOnly, Set-Cookie: Authentication-Token=******; Path=/baocdp; Secure; HttpOnly, Authentication-Token: *******, Content-Type: application/json;charset=UTF-8, Transfer-Encoding: chunked, Date: Tue, 02 Jan 2024 03:46:27 GMT, Keep-Alive: timeout=60, Connection: keep-alive, Server: platform-web-server], responseText:{"login":"true"}, cookies:[JSESSIONID=*****; Path=/baocdp; Secure; HttpOnly, Authentication-Token=*******; Path=/baocdp; Secure; HttpOnly], statusCode:200]"
connection JSON:
{
"authentications": {
"userAuth": {
"authType": "oauth2",
"url": "https://removed/rest/login",
"httpMethod": "POST",
"httpParams": "{\"username\":\"ffff\",\"password\": \"Hy1\"}",
"httpContentType": "application/json",
"httpHeaders": {
"Content-Type": "application/json"
},
"maxRefreshTryCount": 5,
"tokenResponsePath": "#HEADERS#Authentication-Token",
"authHeaderName": "Authentication-Token",
"tokenType": "",
"accessToken": "AAAADN",
"retryFailureStatusCode": [
401
]
}
}
}
createTicketJSon
{"call":[{"name":"call1","connection":"userAuth","url":"https://removed/rest/update ","httpMethod":"POST","httpContentType":"application/json","ticketidPath":"response.data.id","httpHeaders":{"Content-Type":"application/json", "Authentication-Token":"${access_token}"}}}]}
[This message has been edited by moderator to mask sensitive info]
01/01/2024 08:21 PM - edited 01/01/2024 08:23 PM
try below JSON
{
"authentications": {
"userAuth": {
"authType": "oauth2",
"url": "https://10/dp/rest/login",
"httpMethod": "POST",
"httpParams": "{\"username\":\"ffff\",\"password\": \"Hy1\"}",
"httpContentType": "application/json",
"httpHeaders": {
"Content-Type": "application/json"
},
"maxRefreshTryCount": 5,
"tokenResponsePath": "#HEADERS#Set-Cookie",
"authHeaderName": "Authentication-Token",
"tokenType": "",
"accessToken": "AAAADN",
"retryFailureStatusCode": [
401
]
}
}
}
01/01/2024 11:07 PM
i did tried the above json. However its not populating the Authentication-Token header in createTicketJSon.
createTicketJSon:
{"call":[{"name":"call1","connection":"userAuth","url":"https://removed/rest/update ","httpMethod":"POST","httpContentType":"application/json","ticketidPath":"response.data.id","httpHeaders":{"Content-Type":"application/json", "Authentication-Token":"${access_token}"}}}]}
ERROR LOGS:
Got Webservice API Response: [headers:[X-Frame-Options: DENY, Strict-Transport-Security: max-age=31536000; includeSubDomains, Cache-Control: no-store, X-Content-Type-Options: nosniff, Content-Security-Policy: script-src 'self' 'unsafe-inline' 'unsafe-eval' https://*, Pragma: no-cache, X-XSS-Protection: 1; mode=block, X-Powered-By: JSF/1.2, Content-Type: application/json;charset=UTF-8, Content-Language: en-US, Transfer-Encoding: chunked, Date: Tue, 02 Jan 2024 07:04:08 GMT, Keep-Alive: timeout=60, Connection: keep-alive, Server: platform-web-server], responseText:
01/01/2024 11:33 PM
createTicketJSon:
{"call":[{"name":"call1","connection":"userAuth","url":"https://removed/rest/update ","httpMethod":"POST","httpContentType":"application/json","ticketidPath":"response.data.id","httpHeaders":{"Content-Type":"application/json", "Authorization":"${access_token}"}}}]}
01/02/2024 09:28 AM
Share response text - responseText
and when credentials are wrong what is response from postman ?
01/01/2024 11:45 PM - edited 01/01/2024 11:48 PM
The target endpoint basically works with Authentication-Token.
please refer the below link API Responses (Login & Execute process asynchronously)
REF:
01/02/2024 08:38 AM
Team, any update on this? is this a bug?
01/03/2024 10:08 AM - edited 01/03/2024 10:17 AM
01/03/2024 07:26 PM - edited 01/03/2024 07:27 PM
{
"authentications": {
"userAuth": {
"authType": "oauth2",
"url": "https://10/dp/rest/login",
"httpMethod": "POST",
"httpParams": "{\"username\":\"ffff\",\"password\": \"Hy1\"}",
"httpContentType": "application/json",
"httpHeaders": {
"Content-Type": "application/json"
},
"maxRefreshTryCount": 5,
"tokenResponsePath": "#HEADERS#Set-Cookie",
"authHeaderName": "Authentication-Token",
"tokenType": "",
"access_token": "Authentication-Token abc",
"accessToken": "AAAADN",
"retryFailureStatusCode": [
401
]
}
}
}