Saviynt unveils its cutting-edge Intelligence Suite products to revolutionize Identity Security!
Click HERE to see how Saviynt Intelligence is transforming the industry.
Saviynt Copilot Icon

How can I add log entries in JSON configuration of REST Connector?

alc
Regular Contributor
Regular Contributor

Hello,

We configured an endpoint with REST Connector. when we create account, the backend always complain we are missing required attributes but we do setup the required attribute mapping from user attributes. Although we turned on debug with ConfigJSON, but it does not show all attributes we mapped.

How can we add debug log entries in the CreateAccountJSON to print all mapped attribute values?

Thanks

5 REPLIES 5

Amit_Malik
Valued Contributor II
Valued Contributor II

If logs with showlogs=true, are showing the API call and some attributes then that is what Saviynt calling.

Can you share your create account json. We also have a create account json where we have mapped 20 attributes but based on conditions, it sometimes sends 15 , sometimes 16 etc..

 

Kind Regards,
Amit Malik
If this helped you move forward, please click on the "Kudos" button.
If this answers your query, please select "Accept As Solution".

rushikeshvartak
All-Star
All-Star
  • Share your config json and create account json

Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

alc
Regular Contributor
Regular Contributor

Hello Rushikesh,

See attached configuration JSON. the CreateAccountJSON have no issues for parsing because backend server received the request but respond with 400 bad request error which indicate the required attribute were not provided. but we configured all of them. However, we cannot see all the request data in Saviynt log file, that's why I want to add custom log entries to debug.

here is the logs show. we expect it shows all attributes no matter it is null or empty etc. but it only show few attributes, it even does not how the hardcoded value of "status": "Active".

"DEBUG","Calling Webservice Url - https://https://mybackendserver:443/rest/api_add_user with httpParams -
[account:[
username=******&C, I&T Back Office],
groups:[],
auto_assign:Both,
timezone:America/Chicago,
location:Baldwin, IL,
password=******"

{
    "call": [
        {
            "name": "call1",
            "connection": "acctAuth",
            "url": "https://mybackendserver:443/rest/api_add_user",
            "httpMethod": "POST",
            "showResponse": true,
            "httpParams": "{\"account\": {\"username\": \"${arstasksObj?.accountName}\", \"first_name\": \"${user?.firstname?.trim() ?: ''}\", \"last_name\": \"${user?.lastname?.trim() ?: ''}\", \"email\": \"${user?.email?.trim() ?: ''}\", \"pin\": \"${user?.username?.trim().replaceAll('[^0-9]','')}\", \"status\": \"Active\", \"type\": \"${requestAccessAttributes.get('type')?.trim() ?: com.custom.AttributeValueProvider.getAttributeValue('' + arstasksObj.id, 'type')?.trim() ?: 'Signal'}\", \"role\": \"${requestAccessAttributes.get('role')?.trim() ?: com.custom.AttributeValueProvider.getAttributeValue('' + arstasksObj.id, 'role')?.trim() ?: 'Employee'}\", \"departments\": ${requestAccessAttributes.get('departments')?.trim()? requestAccessAttributes.get('departments').split(',').collect{'\"' + it.trim() + '\"'} : com.custom.AttributeValueProvider.getAttributeValue('' + arstasksObj.id, 'departments')?.size() > 0 ? com.custom.AttributeValueProvider.getAttributeValue('' + arstasksObj.id, 'departments').collect{'\"' + it.trim() + '\"'} : []}, \"groups\": ${requestAccessAttributes.get('groups')?.trim()? requestAccessAttributes.get('groups').split(',').collect{'\"' + it.trim() + '\"'} : com.custom.AttributeValueProvider.getAttributeValue('' + arstasksObj.id, 'groups')?.size() > 0 ? com.custom.AttributeValueProvider.getAttributeValue('' + arstasksObj.id, 'groups').collect{'\"' + it.trim() + '\"'} : []}, \"auto_assign\": \"${requestAccessAttributes.get('auto_assign')?.trim() ?: com.custom.AttributeValueProvider.getAttributeValue('' + arstasksObj.id, 'auto_assign')?.trim() ?: 'Both'}\", \"timezone\": \"${requestAccessAttributes.get('timezone')?.trim() ?: com.custom.AttributeValueProvider.getAttributeValue('' + arstasksObj.id, 'timezone')?.trim() ?: 'America/Chicago'}\", \"location\": \"${requestAccessAttributes.get('location')?.trim() ?: com.custom.AttributeValueProvider.getAttributeValue('' + arstasksObj.id, 'location')?.trim() ?: ''}\", \"password\": \"${password}\"}}",
            "httpHeaders": {
                "Authorization": "${access_token}",
            },
            "httpContentType": "application/json",
            "successResponses": {
                "statusCode": [
                    200
                ]
            },
            "unsuccessResponses": {
                "statusCode": [
                    400,
                    401,
                    403,
                    404,
                    409,
                    415,
                    416,
                    429,
                    500,
                    502,
                    503,
                    504
                ]
            }
        }
    ],
    "accountIdPath": "accountName"
}

Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

stalluri
Valued Contributor II
Valued Contributor II

@alc 

{
    "accountIdPath": "accountName",
    "responseColsToPropsMap": {},
    "call": [
        {
            "name": "call1",
            "connection": "acctAuth",
            "url": "https://mybackendserver:443/rest/api_add_user",
            "httpMethod": "POST",
            "showResponse": true,
            "httpParams": "{\"account\": {\"username\": \"${arstasksObj?.accountName}\", \"first_name\": \"${user?.firstname?.trim() ?: ''}\", \"last_name\": \"${user?.lastname?.trim() ?: ''}\", \"email\": \"${user?.email?.trim() ?: ''}\", \"pin\": \"${user?.username?.trim()?.replaceAll('[^0-9]', '')}\", \"status\": \"Active\", \"type\": \"${requestAccessAttributes.get('type')?.trim() ?: com.custom.AttributeValueProvider.getAttributeValue('' + arstasksObj.id, 'type')?.trim() ?: 'Signal'}\", \"role\": \"${requestAccessAttributes.get('role')?.trim() ?: com.custom.AttributeValueProvider.getAttributeValue('' + arstasksObj.id, 'role')?.trim() ?: 'Employee'}\", \"departments\": ${requestAccessAttributes.get('departments')?.trim() ? requestAccessAttributes.get('departments').split(',').collect { '\"' + it.trim() + '\"' } : com.custom.AttributeValueProvider.getAttributeValue('' + arstasksObj.id, 'departments')?.size() > 0 ? com.custom.AttributeValueProvider.getAttributeValue('' + arstasksObj.id, 'departments').collect { '\"' + it.trim() + '\"' } : []}, \"groups\": ${requestAccessAttributes.get('groups')?.trim() ? requestAccessAttributes.get('groups').split(',').collect { '\"' + it.trim() + '\"' } : com.custom.AttributeValueProvider.getAttributeValue('' + arstasksObj.id, 'groups')?.size() > 0 ? com.custom.AttributeValueProvider.getAttributeValue('' + arstasksObj.id, 'groups').collect { '\"' + it.trim() + '\"' } : []}, \"auto_assign\": \"${requestAccessAttributes.get('auto_assign')?.trim() ?: com.custom.AttributeValueProvider.getAttributeValue('' + arstasksObj.id, 'auto_assign')?.trim() ?: 'Both'}\", \"timezone\": \"${requestAccessAttributes.get('timezone')?.trim() ?: com.custom.AttributeValueProvider.getAttributeValue('' + arstasksObj.id, 'timezone')?.trim() ?: 'America/Chicago'}\", \"location\": \"${requestAccessAttributes.get('location')?.trim() ?: com.custom.AttributeValueProvider.getAttributeValue('' + arstasksObj.id, 'location')?.trim() ?: ''}\", \"password\": \"${password}\"}}",
            "httpHeaders": {
                "Authorization": "${access_token}"
            },
            "httpContentType": "application/json",
            "successResponses": {
                "statusCode": [
                    200
                ]
            },
            "unsuccessResponses": {
                "statusCode": [
                    400,
                    401,
                    403,
                    404,
                    409,
                    415,
                    416,
                    429,
                    500,
                    502,
                    503,
                    504
                ]
            }
        }
    ]
}

Best Regards,
Sam Talluri
If you find this a helpful response, kindly consider selecting Accept As Solution and clicking on the kudos button.