Click HERE to see how Saviynt Intelligence is transforming the industry. |
on 08/22/2023 06:23 AM - edited on 04/03/2024 01:49 PM by Rishi
Because of security concerns, sensitive data like passwords etc. should not be displayed in plain text in Import/Provisioning JSON. Also these JSONs with the sensitive data may get displayed in logs, job summary etc. This article describes a solution to store sensitive data in encrypted format while configuring the REST connector.
Target REST APIs should be working fine from postman tool.
Import JSONs should be working fine with the desired credential attributes hardcoded in the JSONs
ALL
{
"authentications": {
"acctAuth": {
"authType": "Basic",
"url": "SAMPLEURL",
"httpMethod": "POST",
"httpParams": {},
"httpHeaders": {},
"httpContentType": "text/html",
"properties": {
"userName": "test.testing@saviynt.com",
"password": "Hello@123"
},
"expiryError": "ExpiredAuthenticationToken",
"authError": [
"InvalidAuthenticationToken",
"AuthenticationFailed"
],
"timeOutError": "Read timed out",
"errorPath": "error.code",
"maxRefreshTryCount": 5,
"tokenResponsePath": "access_token",
"tokenType": "Basic",
"accessToken": "Basic bmlzaGFyLmJhYnVAc2",
"importPassword": "$@v!ynt@2020",
"serverName": "xkbbkk12345",
"assetName": "BMEP@testserv",
"randKey1": "123456qweqwe",
"randKey2": "12asdasd3456",
"randKey3": "123asfasfasfa"
}
}
}
Sample Update Account JSON:
{
"dateFormat": "yyyy-MM-dd'T'HH:mm:ssXXX",
"responseColsToPropsMap": {
"displayName": "call1.message.user.name~#~char"
},
"call": [
{
"name": "Role",
"connection": "acctAuth",
"url": "SAMPLEURL/data/${account.accountID}",
"httpMethod": "PUT",
"httpParams": "{\"user\": {\"name\": \"${connection.importPassword}\"},{\"server\": \"${connection.serverName}\"},{\"name\": \"${connection.assetName}\"},{\"keyval\": \"${connection.randKey1}\"}}",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200,
201
]
}
}
]
}
Sample ImportAccountEntJSON For Exchange Over REST:
{
"globalSettings": {
"dateFormat": "yyyy-MM-dd HH:mm:ss"
},
"accountParams": {
"createUsers": false,
"adminName": "admin",
"processingType": "SequentialAndIterative",
"statusAndThresholdConfig": {
"accountNotInImportAction": "Suspend",
"accountThresholdValue": 100
},
"connection": "acctAuth",
"call": {
"call1": {
"callOrder": 0,
"stageNumber": 0,
"http": {
"url": "<<SAMPLEURL>>",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/x-www-form-urlencoded",
"httpMethod": "POST",
"httpParams": {
"Script": "\\$pass=convertto-securestring ${connection.importPassword} -asplaintext -force; \\$mycred=new-object -typename System.Management.Automation.PSCredential -argumentlist 'xxxxxx\\\\mrsaviyntdev',\\$pass; \\$Session=New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://SAMPLE/PowerShell/ -Authentication Kerberos -Credential \\$mycred; \\$ses=Import-PSSession \\$Session -DisableNameChecking -AllowClobber; Get-RemoteMailbox -identity 'TEST' |Select ExchangeGuid,SamAccountName,UserPrincipalName,WhenMailboxCreated,AddressListMembership,Alias,DisplayName,PrimarySmtpAddress,RecipientType,RecipientTypeDetails,WindowsEmailAddress,GrantSendOnBehalfTo,Name,DistinguishedName,Guid,EmailAddressPolicyEnabled,AccountDisabled"
}
},
"listField": "",
"keyField": "name",
"statusConfig": {
"active": "False",
"inactive": "True"
},
"colsToPropsMap": {
"name": "SamAccountName~#~char",
"created_on": "WhenMailboxCreated~#~datetime",
"displayname": "DisplayName~#~char",
"accountID": "UserPrincipalName~#~char",
"accounttype": "RecipientType~#~char",
"description": "Name~#~char",
"status": "AccountDisabled~#~char",
"comments": "DistinguishedName~#~char",
"customproperty1": "UserPrincipalName~#~char",
"customproperty2 ": "AddressListMembership~#~char ",
"customproperty3": "RecipientTypeDetails~#~char",
"customproperty4": "WindowsEmailAddress~#~char",
"customproperty5": "GrantSendOnBehalfTo~#~char",
"customproperty6": "Alias~#~char",
"customproperty7": "Guid~#~char",
"customproperty8": "ExchangeGuid~#~char",
"customproperty9": "WhenMailboxCreated~#~char",
"customproperty10": "EmailAddressPolicyEnabled~#~char",
"customproperty11": "PrimarySmtpAddress~#~char"
}
}
}
}
}
https://docs.saviyntcloud.com/bundle/REST-v55x/page/Content/Developers-Handbook.htm