Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

Saviynt to Cyberark Account Creation "User name ${user.username} is invalid"

sandeepverma
Regular Contributor
Regular Contributor

Hi Team,

We are using CyberArkConnector to create the user in CyberArk and we are using the below createAccountJson block.

{
"accountIdPath": "call1.message.id",
"dateFormat" : "yyyy-MM-dd'T'HH:mm:ssXXX",
"responseColsToPropsMap": {
"name": "call1.message.userName~#~char",
"displayName": "call1.message.name.givenName~#~char",
"customproperty1": "call1.message.name.givenName~#~cha~#~char",
"customproperty2": "call1.message.name.familyName~#~cha~#~char",
"customproperty13": "call1.message.meta.location~#~char"
},
"call": [
{
"name": "call1",
"connection": "acctAuth",
"url": "https://*******.cyberark.cloud/scim/v2/Users",
"httpMethod": "POST",
"httpParams": "{\"userName\":\"${user.username}\",\"name\":{\"givenName\":\"${user.firstname}\",\"familyName\":\"${user.lastname}\"},\"password\":\"********\"}",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
201,
200
]
},
"unsuccessResponses": {
"statusCode": [
400,
500
]
}
}
]
}

but we are getting error while provisioning the account to cyberark.

ERROR: 

sandeepverma_0-1708693790628.png

and whenever I am passing the hardcoded value for username from connector it's working.

Could you please assist here.

I am following Saviynt doc Configuring a Connection (saviyntcloud.com)

Thanks

8 REPLIES 8

rushikeshvartak
All-Star
All-Star

try below 

{
  "accountIdPath": "call1.message.id",
  "dateFormat" : "yyyy-MM-dd'T'HH:mm:ssXXX",
  "responseColsToPropsMap": {
    "name": "call1.message.userName~#~char",
    "displayName": "call1.message.name.givenName~#~char",
    "customproperty1": "call1.message.name.givenName~#~cha~#~char",
    "customproperty2": "call1.message.name.familyName~#~cha~#~char",
    "customproperty13": "call1.message.meta.location~#~char"
  },
  "call": [
    {
      "name": "call1",
      "connection": "acctAuth",
      "url": "@@BASE_URL@@/CyberArk/scim/v2/Users",
      "httpMethod": "POST",
      "httpParams": "{\"userName\":\"${user.username}\",\"name\":{\"givenName\":\"${user.firstname}\",\"familyName\":\"${user.lastname}\"}}",
      "httpHeaders": {
        "Authorization": "${access_token}"
      },
      "httpContentType": "application/json",
    "successResponses": {
        "statusCode": [
          201,
          200
        ]
      },
      "unsuccessResponses": {
        "statusCode": [
          400,
          500
        ]
      }
    }
  ]
}

Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

Hi @rushikeshvartak 

Thanks for reply.

I compared but I don't see any code changes in codes.

Please let me know if there are any changes.

Thanks

try users.


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

sandeepverma
Regular Contributor
Regular Contributor

not worked.

gauravshukla
Saviynt Employee
Saviynt Employee

It seems like ${user.username} is not resolved here. It is going as it is in the provisioning. So it says ${user.username} is invalid.

sandeepverma
Regular Contributor
Regular Contributor

Hi @gauravshukla 

So, what would be the solution here?

Thanks

gauravshukla
Saviynt Employee
Saviynt Employee
I was testing as below alernatives but couldn't find the solution to it. 
  1. ${user.username}
  2. ${task.accountName}
  3. ${user.firstname}${user.lastname}@suffix
  4. ${user.systemUserName}@suffix
  5. changed the userName(leftside variable) to username as well.
Note: suffix is something like abc.com
Whatever the code is entered, it is being send to CyberArk as it is.


gauravshukla
Saviynt Employee
Saviynt Employee
I have tested the create account and it is working now.
 
The issue was with the hardcoded password having the '$' in it. When we use '$' as hardcoded value, the code will expect it as a binding variable. Due to that, binding variable did not resolve.
 
I removed '$' from the password and it worked.
 
Regards,
Gaurav Shukla
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.