Click HERE to see how Saviynt Intelligence is transforming the industry. |
09/06/2024 08:37 AM
Hello,
I'm working on a REST connector that should call a custom Web Service to first receive a bearer access token for connection, and then do another API call for the ChangePassJSON.
Connectivity is working fine and also a simple API "GET" call inside the testing block is working fine.
Problem is with the API in the ChangePassJSON.
After changing password from the "Change account Password for self" in Saviynt, a task is created. When I run the job for provisioning, the job is successful but the task remains in Pending status.
Also, from Web Service logs, it seems that the server does not receive neither the call for requesting access token nor the call of the change password API.
API is working fine from Postman.
ChangePassJSON:
{
"http":{
"url":"http://aaa.aaa.aaa.aaa:9001/api/changepsw",
"httpHeaders":{
"Authorization":"${access_token}",
"Content-Type":"application/json"
},
"httpContentType":"application/json",
"httpMethod":"POST",
"httpParams":{
"username":"${username}",
"newPassword":"${password}"
}
},
"successResponse":[
],
"successResponsePath":"",
"errors":[
"Couldn't authenticate you"
],
"errorPath":"error"
}
I'm attaching the logs and it seems this is the main error: Error in processWebservicejava.lang.NullPointerException: Cannot invoke method size() on null object
Thank you
Solved! Go to Solution.
09/06/2024 08:46 AM
@FabianaS
Can you try these and share the logs in text format.
${task.password}
${randompassword}
${account_password}
09/09/2024 06:59 AM
with ${task.password}
2024-09-09T13:48:34.874+00:00 | ecm-worker | services.ArsTaskHelperService | quartzScheduler_Worker-8-9rp2v | DEBUG | Validating tasks for Securitysystem - WS_PSWSYNC | |
2024-09-09T13:48:34.874+00:00 | ecm-worker | services.ArsTaskHelperService | quartzScheduler_Worker-8-9rp2v | DEBUG | accountName = f.sessa , taskType = 5 accountkey = 174402 | |
2024-09-09T13:48:34.881+00:00 | ecm-worker | pam.PamService | quartzScheduler_Worker-8-9rp2v | DEBUG | inside convertJsonStringToMap | |
2024-09-09T13:48:34.881+00:00 | ecm-worker | pam.PamService | quartzScheduler_Worker-8-9rp2v | DEBUG | rotateKey - true | |
2024-09-09T13:48:34.889+00:00 | ecm-worker | pam.PamService | quartzScheduler_Worker-8-9rp2v | DEBUG | Granular Password Rotation is : 0 | |
2024-09-09T13:48:34.898+00:00 | ecm-worker | services.ArsTaskService | quartzScheduler_Worker-8-9rp2v | DEBUG | Calling provisionAccountsAccess with Sec System - WS_PSWSYNC and tasklist - [f.sessa:[com.saviynt.ecm.task.ArsTasks : 1969]] | |
2024-09-09T13:48:34.898+00:00 | ecm-worker | rest.RestProvisioningService | quartzScheduler_Worker-8-9rp2v | DEBUG | Processing Change Account Password Task for REST | |
2024-09-09T13:48:34.899+00:00 | ecm-worker | rest.RestProvisioningService | quartzScheduler_Worker-8-9rp2v | DEBUG | initializing Provisioning connection | |
2024-09-09T13:48:34.902+00:00 | ecm-worker | rest.RestProvisioningService | quartzScheduler_Worker-8-9rp2v | DEBUG | Tasks to work on = 1 | |
2024-09-09T13:48:34.902+00:00 | ecm-worker | rest.RestProvisioningService | quartzScheduler_Worker-8-9rp2v | DEBUG | accounts accountID =f.sessa | |
2024-09-09T13:48:34.902+00:00 | ecm-worker | rest.RestProvisioningService | quartzScheduler_Worker-8-9rp2v | DEBUG | account: f.sessa | |
2024-09-09T13:48:34.902+00:00 | ecm-worker | rest.RestProvisioningService | quartzScheduler_Worker-8-9rp2v | DEBUG | account?.systemid: 14 | |
2024-09-09T13:48:34.928+00:00 | ecm-worker | services.SaviyntCommonUtilityService | quartzScheduler_Worker-8-9rp2v | DEBUG | Enter getStandardBindingVariable | |
2024-09-09T13:48:34.930+00:00 | ecm-worker | services.SaviyntCommonUtilityService | quartzScheduler_Worker-8-9rp2v | DEBUG | Exit getStandardBindingVariable | |
2024-09-09T13:48:34.930+00:00 | ecm-worker | rest.RestProvisioningService | quartzScheduler_Worker-8-9rp2v | ERROR | Error in processWebservicejava.lang.NullPointerException: Cannot invoke method size() on null object | |
2024-09-09T13:48:34.930+00:00 | ecm-worker | rest.RestProvisioningService | quartzScheduler_Worker-8-9rp2v | DEBUG | Task Response: null | |
2024-09-09T13:48:34.931+00:00 | ecm-worker | rest.RestProvisioningService | quartzScheduler_Worker-8-9rp2v | DEBUG | Result: false | |
2024-09-09T13:48:34.933+00:00 | ecm-worker | services.ArsTaskService | quartzScheduler_Worker-8-9rp2v | DEBUG | changePasswordAccountTarget - res - true | |
2024-09-09T13:48:34.934+00:00 | ecm-worker | services.ArsTaskService | quartzScheduler_Worker-8-9rp2v | DEBUG | Inside updateProvisioningTries.. | |
2024-09-09T13:48:34.948+00:00 | ecm-worker | services.ArsTaskService | quartzScheduler_Worker-8-9rp2v | DEBUG | Enter completePasswordTasks | |
2024-09-09T13:48:34.948+00:00 | ecm-worker | services.ArsTaskService | quartzScheduler_Worker-8-9rp2v | DEBUG | Exit completePasswordTasks |
${randompassword}
2024-09-09T13:56:11.268+00:00 | ecm-worker | services.ArsTaskHelperService | quartzScheduler_Worker-1-9rp2v | DEBUG | Validating tasks for Securitysystem - WS_PSWSYNC | |||||||||||||||||||
2024-09-09T13:56:11.269+00:00 | ecm-worker | services.ArsTaskHelperService | quartzScheduler_Worker-1-9rp2v | DEBUG | accountName = f.sessa , taskType = 5 accountkey = 174402 | |||||||||||||||||||
2024-09-09T13:56:11.276+00:00 | ecm-worker | pam.PamService | quartzScheduler_Worker-1-9rp2v | DEBUG | inside convertJsonStringToMap | |||||||||||||||||||
2024-09-09T13:56:11.276+00:00 | ecm-worker | pam.PamService | quartzScheduler_Worker-1-9rp2v | DEBUG | rotateKey - true | |||||||||||||||||||
2024-09-09T13:56:11.283+00:00 | ecm-worker | pam.PamService | quartzScheduler_Worker-1-9rp2v | DEBUG | Granular Password Rotation is : 0 | |||||||||||||||||||
2024-09-09T13:56:11.293+00:00 | ecm-worker | services.ArsTaskService | quartzScheduler_Worker-1-9rp2v | DEBUG | Calling provisionAccountsAccess with Sec System - WS_PSWSYNC and tasklist - [f.sessa:[com.saviynt.ecm.task.ArsTasks : 1969]] | |||||||||||||||||||
2024-09-09T13:56:11.294+00:00 | ecm-worker | rest.RestProvisioningService | quartzScheduler_Worker-1-9rp2v | DEBUG | Processing Change Account Password Task for REST | |||||||||||||||||||
2024-09-09T13:56:11.294+00:00 | ecm-worker | rest.RestProvisioningService | quartzScheduler_Worker-1-9rp2v | DEBUG | initializing Provisioning connection | |||||||||||||||||||
2024-09-09T13:56:11.297+00:00 | ecm-worker | rest.RestProvisioningService | quartzScheduler_Worker-1-9rp2v | DEBUG | Tasks to work on = 1 | |||||||||||||||||||
2024-09-09T13:56:11.297+00:00 | ecm-worker | rest.RestProvisioningService | quartzScheduler_Worker-1-9rp2v | DEBUG | accounts accountID =f.sessa | |||||||||||||||||||
2024-09-09T13:56:11.297+00:00 | ecm-worker | rest.RestProvisioningService | quartzScheduler_Worker-1-9rp2v | DEBUG | account: f.sessa | |||||||||||||||||||
2024-09-09T13:56:11.297+00:00 | ecm-worker | rest.RestProvisioningService | quartzScheduler_Worker-1-9rp2v | DEBUG | account?.systemid: 14 | |||||||||||||||||||
2024-09-09T13:56:11.322+00:00 | ecm-worker | services.SaviyntCommonUtilityService | quartzScheduler_Worker-1-9rp2v | DEBUG | Enter getStandardBindingVariable | |||||||||||||||||||
2024-09-09T13:56:11.324+00:00 | ecm-worker | services.SaviyntCommonUtilityService | quartzScheduler_Worker-1-9rp2v | DEBUG | Exit getStandardBindingVariable | |||||||||||||||||||
2024-09-09T13:56:11.325+00:00 | ecm-worker | rest.RestProvisioningService | quartzScheduler_Worker-1-9rp2v | ERROR | Error in processWebservicejava.lang.NullPointerException: Cannot invoke method size() on null object | |||||||||||||||||||
2024-09-09T13:56:11.325+00:00 | ecm-worker | rest.RestProvisioningService | quartzScheduler_Worker-1-9rp2v | DEBUG | Task Response: null | |||||||||||||||||||
2024-09-09T13:56:11.325+00:00 | ecm-worker | rest.RestProvisioningService | quartzScheduler_Worker-1-9rp2v | DEBUG | Result: false | |||||||||||||||||||
2024-09-09T13:56:11.328+00:00 | ecm-worker | services.ArsTaskService | quartzScheduler_Worker-1-9rp2v | DEBUG | changePasswordAccountTarget - res - true | |||||||||||||||||||
2024-09-09T13:56:11.329+00:00 | ecm-worker | services.ArsTaskService | quartzScheduler_Worker-1-9rp2v | DEBUG | Inside updateProvisioningTries.. | |||||||||||||||||||
2024-09-09T13:56:11.347+00:00 | ecm-worker | services.ArsTaskService | quartzScheduler_Worker-1-9rp2v | DEBUG | Enter completePasswordTasks | |||||||||||||||||||
2024-09-09T13:56:11.347+00:00 | ecm-worker | services.ArsTaskService | quartzScheduler_Worker-1-9rp2v | DEBUG | Exit completePasswordTasks |
09/09/2024 07:23 AM
Share in text file please
09/09/2024 08:44 AM
09/09/2024 08:58 AM
"2024-09-09T13:55:39.818+00:00","ecm","rest.RestProvisioningService","http-nio-8080-exec-545-tzzxj","DEBUG","Got Webservice API Response: [headers:[WWW-Authenticate: Bearer error="invalid_token", error_description="An error occurred while attempting to decode the Jwt: Signed JWT rejected: Another algorithm expected, or no matching key(s) found", error_uri="https://tools.ietf.org/html/rfc6750#section-3.1", X-Content-Type-Options: nosniff, X-XSS-Protection: 0, Cache-Control: no-cache, no-store, max-age=0, must-revalidate, Pragma: no-cache, Expires: 0, X-Frame-Options: DENY, Content-Length: 0, Date: Mon, 09 Sep 2024 13:55:39 GMT, Keep-Alive: timeout=60, Connection: keep-alive], responseText:, cookies:[], statusCode:401]"
Does other JSON's working ?
09/06/2024 09:05 AM
Does it works from postman ?
09/06/2024 09:09 AM
yes
09/06/2024 09:11 AM
Please share postman screenshot and curl command [Refer https://codingnconcepts.com/postman/how-to-generate-curl-command-from-postman/ ]
⚠️‼️‼️Do not upload any attachments that contain sensitive information, such as IP Addresses, URLs, Company/Employee Names, Email Addresses, etc.‼️‼️⚠️
09/09/2024 07:08 AM
cURL:
curl --location 'http://aaa.aaa.aaa.aaa:9001/api/changepsw' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJraWQiOiIxMzg1OWY4Zi01MzY2LTRhNGUtYWYxYy0xOWUxMjI3NDk4MWIiLCJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJodHRwOi8vMTY0LjEyOS4yMjAuMTY1OjkwMDEiLCJzdWIiOiJXU1N5bmNocm9JRCIsImF1ZCI6IldTU3luY2hyb0lEIiwibmJmIjoxNzI1ODkwNDIxLCJleHAiOjE3MjU4OTIyMjEsImlhdCI6MTcyNTg5MDQyMX0.rGgZPRxrzAqwDL1TSgx3fKM8koO89FTERikYEIy5JIfyEW_hn99604rvT4rpiwmFAueK1abJ80Un2gWdIoZxXHEDQxf5FfsSDK3ZpaTpseeaP97Z30imE1kJBsIFv49Cf_M0W6UeoIPHEtcja_hluNTL6_sXrbi0cGdxunSjPdOkcGUwjK6GO8JnlYdWQ8CZFJcwZBryTScnWWtyD6uJmdKGqowmXQ7t9pKeITK2kg-dk2q7gJv6BO6J8eH6syBbBJ1vteL8CvtZ6Px523RJCS9iT3Z7hck9O6WWstpkXzrxtmE6E7Yt6mehH50QQA41natr0ckuPrJIh0cLhI8q_g' \
--data '{
"username": "Test18",
"newPassword": "newPassword2!"
}'
09/09/2024 08:50 AM - edited 09/09/2024 08:51 AM
Change it to:
"httpParams":"{}",
"Properties":{
"username":"${username}",
"newPassword":"${password}"
}
09/09/2024 09:03 AM
09/09/2024 09:04 AM
Can you share configs screenshot to validate its done in proper block
09/09/2024 09:35 AM - last edited on 09/09/2024 10:22 AM by Dave
Do you mean the connectionJSON?
{
"authentications": {
"acctAuth": {
"authType": "oauth2",
"url": "http://aaa.aaa.aaa.aaa:9001/oauth2/token",
"httpMethod": "POST",
"httpParams": {
"grant_type": "client_credentials"
},
"httpHeaders": {
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Basic xxxxxxxxxxxx"
},
"expiryError": "ExpiredAuthenticationToken",
"authError": [
"Unable to authenticate the client",
"Invalid OAuth token Bearer"
],
"retryFailureStatusCode": [
401,
403
],
"httpContentType": "application/x-www-form-urlencoded",
"errorPath": "error.code",
"maxRefreshTryCount": 5,
"tokenResponsePath": "access_token",
"tokenType": "Bearer",
"testConnectionParams": {
"http": {
"url": "http://aaa.aaa.aaa.aaa:9001/api/test",
"httpHeaders": {
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "${access_token}"
},
"httpMethod": "GET"
},
"httpParams":{},
"successResponse": [],
"successResponsePath": "",
"errors": [
"Couldn't authenticate you"
],
"httpContentType": "application/x-www-form-urlencoded",
"errorPath": "error"
}
}
}
}
Here is the config:
Unfortunately ChangePassJSON is the only JSON I'm developing on this REST connector. Connection and test is working, Im also able to see it from my server logs:
[This post has been edited by a Moderator to remove sensitive information.]
09/09/2024 10:19 AM
Share postman screenshot of authentication
09/09/2024 10:36 AM - edited 09/09/2024 10:37 AM
{
"call": [
{
"name": "call1",
"connection": "acctAuth",
"url": "http://aaa.aaa.aaa.aaa:9001/api/changepsw",
"httpMethod": "POST",
"httpParams": "{\"username\": \"${user.username}\", \"newPassword\": \"${password}\"}",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
201,
200,
204
]
}
}
]
}