Click HERE to see how Saviynt Intelligence is transforming the industry. |
10/16/2023 01:05 AM - last edited on 10/16/2023 02:29 AM by Sunil
Hi @saviynt Team,
Request you to look into this on priority.
Attaching the connection JSON : Connection JSON for application .
{ "authentications": { "acctAuth": { "authType": "BasicWithAccessToken", "url": "https:///ws/rest/service/v1/login", "httpMethod": "GET", "httpHeaders": { "Accept": "application/json", }, "properties": { "userName": "<>", "password": "<>" }, "httpContentType": "application/json", "expiryError": "ExpiredAuthenticationToken", "authError": [ "InvalidAuthenticationToken", "AuthenticationFailed", "Authentication_MissingOrMalformed", "Authentication_ExpiredToken" ], "retryFailureStatusCode": [403,401,500], "timeOutError": "Read timed out", "errorPath": "Error.Message", "maxRefreshTryCount": 6, "tokenResponsePath": "token", "tokenType": "Bearer", "accessToken": "Bearer abcd", "retryFailureStatusCode": [ 401 ] } } }
Could you please check and let me know what I missed.
Logs : DEBUG services.HttpClientUtilityService - called executePostRequestWithHeaders for api... 2023-10-12/07:26:12.659 [{}] [quartzScheduler_Worker-15] DEBUG services.HttpClientUtilityService - after calling executeRequestWithHeaders for api... 2023-10-12/07:26:12.659 [{}] [quartzScheduler_Worker-15] DEBUG services.HttpClientUtilityService - called api... 2023-10-12/07:26:12.659 [{}] [quartzScheduler_Worker-15] DEBUG services.HttpClientUtilityService - timeout validated for api... 2023-10-12/07:26:12.659 [{}] [quartzScheduler_Worker-15] DEBUG services.HttpClientUtilityService - got response for api... 2023-10-12/07:26:12.659 [{}] [quartzScheduler_Worker-15] DEBUG rest.RestUtilService - Got showLogs = true 2023-10-12/07:26:12.659 [{}] [quartzScheduler_Worker-15] DEBUG rest.RestProvisioningService - Got Webservice API Response: [headers:[Date: Thu, 12 Oct 2023 07:26:12 GMT, Content-Length: 12, Content-Type: text/html; charset=UTF-8, WWW-Authenticate: Bearer, X-Content-Type-Options: nosniff, X-Frame-Options: DENY], responseText:Unauthorized, cookies:[], statusCode:401] 2023-10-12/07:26:12.659 [{}] [quartzScheduler_Worker-15] DEBUG rest.RestUtilService - pullObjectsByRest - responseStatusCode ::401
updating new connection json :
Connection JSON for application .
{
"authentications":
{
"acctAuth": {
"authType": "BasicWithAccessToken",
"url": "https://<ServerName>/ws/rest/service/v1/login",
"httpMethod": "GET",
"httpHeaders": {
"Accept": "application/json",
},
"properties": {
"userName": "<<username>>",
"password": "<<PWD>>"
},
"httpContentType": "application/json",
"expiryError": "ExpiredAuthenticationToken",
"authError": [
"InvalidAuthenticationToken",
"AuthenticationFailed",
"Authentication_MissingOrMalformed",
"Authentication_ExpiredToken"
],
"retryFailureStatusCode": [403,401,500],
"timeOutError": "Read timed out",
"errorPath": "Error.Message",
"maxRefreshTryCount": 6,
"tokenResponsePath": "token",
"tokenType": "Bearer",
"accessToken": "Bearer abcd",
"retryFailureStatusCode": [
401
]
}
}
}
[This message has been edited by moderator to merge reply comment]
Solved! Go to Solution.
10/16/2023 08:25 PM
Hello @IAM-Vaibhav,
Can you please try with the post call, also make sure the response path is correct,
{
"authentications": {
"acctAuth": {
"authType": "BasicWithAccessToken",
"url": "https://<ServerName>/ws/rest/service/v1/login",
"httpMethod": "POST",
"httpHeaders": {
"Accept": "application/json"
},
"properties": {
"userName": "<<username>>",
"password": "<<PWD>>"
},
"httpContentType": "application/json",
"expiryError": "ExpiredAuthenticationToken",
"authError": [
"InvalidAuthenticationToken",
"AuthenticationFailed",
"Authentication_MissingOrMalformed",
"Authentication_ExpiredToken"
],
"retryFailureStatusCode": [403, 401, 500],
"timeOutError": "Read timed out",
"errorPath": "Error.Message",
"maxRefreshTryCount": 6,
"tokenResponsePath": "token",
"tokenType": "Bearer",
"accessToken": "Bearer abcd",
"retryFailureStatusCode": [
401
]
}
}
}
If this doesn't work please share the postman reponse as well.
Thanks
10/16/2023 11:06 PM - edited 10/16/2023 11:17 PM
Hi @sudeshjaiswal ,
Thanks for your reply. As suggested, i did try with POST request in the response I got method not allowed error message.
Below is the response of the login API when successfully got called.
10/17/2023 12:13 AM
Hello @IAM-Vaibhav,
Thanks for sharing the postman response, Please try use the below sample json and modify accordingly.
{
"authentications": {
"acctAuth": {
"authType": "oauth2",
"url": "url",
"httpMethod": "GET",
"httpHeaders": {
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Basic c3VkZXNoOnBhc3N3b3Jk"
},
"httpContentType": "application/x-www-form-urlencoded",
"expiryError": "Access token is expired.",
"authError": [
"ExpiredAuthenticationToken",
"Access token is expired.",
"InvalidAuthenticationToken",
"USER_AUTHENTICATION_FAILED",
"PARTNER_AUTHENTICATION_FAILED",
"AuthenticationFailed",
"HTTP ERROR: 401"
],
"refreshType": "RefreshToken",
"refreshTokenResponsePath": "refresh_token",
"refreshToken": "",
"timeOutError": "Read timed out",
"errorPath": "message",
"maxRefreshTryCount": 5,
"tokenResponsePath": "token",
"tokenType": "Bearer",
"retryFailureStatusCode": [
401
],
"accessToken": "Bearer fghjkascghjk"
}
}
}
and in the authorization i have encoded it using base 64
## Get the token from encoding to base64
https://www.base64encode.org/
I have added the screenshot for your reference. How to generate the authorization token
Give username:password as shown below
11/02/2023 03:35 AM
Hi @sudeshjaiswal ,
i tested your suggestion, still getting same error.
2023-11-02/10:02:43.147 [{}] [quartzScheduler_Worker-10] DEBUG services.HttpClientUtilityService - after calling executeRequestWithHeaders for api...
2023-11-02/10:02:43.147 [{}] [quartzScheduler_Worker-10] DEBUG services.HttpClientUtilityService - called api...
2023-11-02/10:02:43.147 [{}] [quartzScheduler_Worker-10] DEBUG services.HttpClientUtilityService - timeout validated for api...
2023-11-02/10:02:43.147 [{}] [quartzScheduler_Worker-10] DEBUG services.HttpClientUtilityService - got response for api...
2023-11-02/10:02:43.147 [{}] [quartzScheduler_Worker-10] DEBUG rest.RestUtilService - Got showLogs = true
2023-11-02/10:02:43.147 [{}] [quartzScheduler_Worker-10] DEBUG rest.RestProvisioningService - Got Webservice API Response: [headers:[Date: Thu, 02 Nov 2023 10:02:43 GMT, Content-Length: 12, Content-Type: text/html; charset=UTF-8, WWW-Authenticate: Bearer, X-Content-Type-Options: nosniff, X-Frame-Options: DENY], responseText:Unauthorized, cookies:[], statusCode:401]
2023-11-02/10:02:43.147 [{}] [quartzScheduler_Worker-10] DEBUG rest.RestUtilService - pullObjectsByRest - responseStatusCode ::401
2023-11-02/10:02:43.147 [{}] [quartzScheduler_Worker-10] ERROR rest.RestProvisioningService - Exception in pullObjectsByRest :401
2023-11-02/10:02:43.147 [{}] [quartzScheduler_Worker-10] ERROR rest.RestProvisioningService - Inside token Expiry Exception block. connectionParamMap.refreshTryCount : 1
2023-11-02/10:02:43.147 [{}] [quartzScheduler_Worker-10] DEBUG rest.RestProvisioningService - Incrementing connectionParamMap.refreshTryCount : 2
11/02/2023 07:04 AM
Hello @IAM-Vaibhav,
Can you please share your connection json, (Please mask the confidential information.)
Thanks.
11/02/2023 09:11 AM
Here is json :
{
"authentications": {
"acctAuth": {
"authType": "oauth2",
"url": "https://hostname/ws/rest/service/v1/login",
"httpMethod": "GET",
"httpHeaders": {
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Basic <USER:PASSWORD in 64bit encode>"
},
"httpContentType": "application/x-www-form-urlencoded",
"expiryError": "Access token is expired.",
"authError": [
"ExpiredAuthenticationToken",
"Access token is expired.",
"InvalidAuthenticationToken",
"USER_AUTHENTICATION_FAILED",
"PARTNER_AUTHENTICATION_FAILED",
"AuthenticationFailed",
"HTTP ERROR: 401"
],
"refreshType": "RefreshToken",
"refreshTokenResponsePath": "refresh_token",
"refreshToken": "",
"timeOutError": "Read timed out",
"errorPath": "message",
"maxRefreshTryCount": 5,
"tokenResponsePath": "token",
"tokenType": "Bearer",
"retryFailureStatusCode": [
401
],
"accessToken": "Bearer abc"
}
}
}
11/06/2023 12:13 AM
Did you get a chance to check this.
11/06/2023 10:31 AM
Hello @IAM-Vaibhav ,
Your connection json looks fine to me,
but as per the log its is getting the 401 status code which indicates that the tokens/password are not passed correctly.
Thanks
11/07/2023 02:28 AM
Hi @sudeshjaiswal ,
Thanks for the update, what would you suggest here, Could you please advise next steps from here.
regards ,
VP.
11/07/2023 09:24 PM
Hello @IAM-Vaibhav,
Can you please try passing the credentials in HttpParams.
Please find the below sample.
{
"authentications": {
"userAuth": {
"authType": "oauth2",
"httpHeaders": {
"Content-Type": "application/json"
},
"authError": [
"AuthenticationFailed",
"ExpiredJwtException",
"401 Unauthorized",
"401",
"403",
"400"
],
"url": "https://hostname/ws/rest/service/v1/login",
"httpMethod": "GET",
"httpContentType": "application/json",
"errorPath": "code",
"maxRefreshTryCount": 6,
"tokenResponsePath": "access_token",
"tokenType": "Bearer",
"authHeaderName": "Authorization",
"accessToken": "Bearer sadasd",
"httpParams": "{\"username\":\"admin\",\"password\":\"password\"}",
"retryFailureStatusCode": [
401,
500,
400,
403
]
}
}
}
Thanks.
11/08/2023 04:33 AM
Hi @sudeshjaiswal ,
Thanks for the reply.
I tested this json and still the same issue.
2023-11-08/12:20:42.526 [{}] [quartzScheduler_Worker-3] DEBUG rest.RestProvisioningService - Calling Webservice Url - https://<hostname>/ws/rest/service/v1/admin/user/get with httpParams - null
2023-11-08/12:20:42.526 [{}] [quartzScheduler_Worker-3] DEBUG services.HttpClientUtilityService - calling executeRequestWithTimeoutConfig for api...
2023-11-08/12:20:42.526 [{}] [quartzScheduler_Worker-3] DEBUG services.HttpClientUtilityService - calling api...
2023-11-08/12:20:42.527 [{}] [quartzScheduler_Worker-3] DEBUG services.HttpClientUtilityService - before calling executeRequestWithHeaders for api...
2023-11-08/12:20:42.527 [{}] [quartzScheduler_Worker-3] DEBUG services.HttpClientUtilityService - isFipsEnabled = false
2023-11-08/12:20:42.527 [{}] [quartzScheduler_Worker-3] DEBUG services.HttpClientUtilityService - getHttpClient - sslParams : null
2023-11-08/12:20:42.527 [{}] [quartzScheduler_Worker-3] DEBUG services.HttpClientUtilityService - getHttpClient - proxyParams : null
2023-11-08/12:20:42.527 [{}] [quartzScheduler_Worker-3] DEBUG services.HttpClientUtilityService - getHttpClient - sslSocketFactory : null
2023-11-08/12:20:42.527 [{}] [quartzScheduler_Worker-3] DEBUG services.HttpClientUtilityService - setting connection timeout to 120 seconds and request timeout to 60 seconds
2023-11-08/12:20:42.527 [{}] [quartzScheduler_Worker-3] DEBUG services.HttpClientUtilityService - getHttpClient - HttpClientBuilder.create().build() called.
2023-11-08/12:20:42.781 [{}] [quartzScheduler_Worker-3] DEBUG services.HttpClientUtilityService - called executePostRequestWithHeaders for api...
2023-11-08/12:20:42.781 [{}] [quartzScheduler_Worker-3] DEBUG services.HttpClientUtilityService - after calling executeRequestWithHeaders for api...
2023-11-08/12:20:42.781 [{}] [quartzScheduler_Worker-3] DEBUG services.HttpClientUtilityService - called api...
2023-11-08/12:20:42.781 [{}] [quartzScheduler_Worker-3] DEBUG services.HttpClientUtilityService - timeout validated for api...
2023-11-08/12:20:42.781 [{}] [quartzScheduler_Worker-3] DEBUG services.HttpClientUtilityService - got response for api...
2023-11-08/12:20:42.781 [{}] [quartzScheduler_Worker-3] DEBUG rest.RestUtilService - Got showLogs = true
2023-11-08/12:20:42.781 [{}] [quartzScheduler_Worker-3] DEBUG rest.RestProvisioningService - Got Webservice API Response: [headers:[Date: Wed, 08 Nov 2023 12:20:42 GMT, Content-Length: 12, Content-Type: text/html; charset=UTF-8, WWW-Authenticate: Bearer, X-Content-Type-Options: nosniff, X-Frame-Options: DENY], responseText:Unauthorized, cookies:[], statusCode:401]
11/08/2023 09:23 PM - edited 11/12/2023 07:22 PM
Hello @IAM-Vaibhav,
Thanks.