Click HERE to see how Saviynt Intelligence is transforming the industry. |
05/16/2024 08:38 AM
Hi Team,
We are getting the response from one of the REST api for CreateUser, Which included the UserDetails and RoleDetails in same api https://localhost:3780/api/3/users
but the issue when we try to call the CreateAccount JSON with out role details we are getting error from the postman, which mean to create account is not allowing without role details. In this case how can we pass the role details into the createaccount JSON dynamically.
Sample CreateUser API response as below:
{
"authentication": {
"id": "2",
"type": "normal"
},
"email": "test12@test.com",
"enabled": true,
"locale": {
"default": "",
"links": [
{
"href": "XXXXXXX/api/3/users",
"rel": "self"
}
],
"reports": "en-US"
},
"login": "XXXXXXX",
"name": "XXXXXXXXX",
"password": "XXXXXXXX",
"passwordResetOnLogin": false,
"role": {
"allAssetGroups": false,
"allSites": false,
"id": "View Only",
"superuser": false
}
}
Please find the below CreateAccount JSON which we are trying to hardcode the role attribute value as "View Only". Any suggestion how to pass the role value dynamically, as we have list of roles we are getting in the response.
{
"accountIdPath": "accountName",
"dateFormat": "yyyy-MM-dd'T'HH:mm:ssXXX",
"call": [
{
"name": "call1",
"connection": "acctAuth",
"showResponse": false,
"url": "XXXXXXXXXX/user-api/users",
"httpMethod": "POST",
"httpParams": "{\"active\": \"true\", \"eid\": \"${user.username}\", \"email\": \"${user.email.toLowerCase()}\", \"firstName\": \"${user.firstname}\", \"lastName\":\"${user.lastname}\", \"name\":\"${user.firstname+' '+user.lastname}\", \"role\":\"View Only\"}",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
201,
200
]
},
"unsuccessResponses": {
"statusCode": [
400,
401,
403,
404
]
}
}
]
}
Solved! Go to Solution.
05/16/2024 10:26 AM
@mahammed_raffi Sample below
"acctEntMappings": {
"Roles": {
"importAsEntitlement": true,
"listPath": "roles",
"idPath": "id",
"keyField": "entitlementID",
"colsToPropsMap": {
"entitlementID": "id~#~char",
"entitlement_value": "name~#~char",
"customproperty1": "description~#~char"
}
}
}
},
"entitlementParams": {
"connection": "acctAuth",
"processingType": "SequentialAndIterative",
"entTypes": {
"Roles": {}
}
},
"acctEntParams": {
"processingType": "acctToEntMapping"
}
}
https://forums.saviynt.com/t5/identity-governance/import-coupa-roles-entitlements/m-p/70113
05/16/2024 07:28 PM
You can't fetch Entitlement/Role information in createaccount you need to create dynamic attribute for this purpose and use in createaccount json
05/17/2024 01:08 AM
Hi Rushikesh,
Can you please provide any sample createaccount json which similar to above use case ?
I have tried with the below and it didn't work somehow.
CreateAccount Json :
{
"accountIdPath": "accountName",
"dateFormat": "yyyy-MM-dd'T'HH:mm:ssXXX",
"call": [
{
"name": "call1",
"connection": "acctAuth",
"showResponse": false,
"url": "XXXXXXXXXXX/api/3/users",
"httpMethod": "POST",
"httpParams": "{\"authentication\":{ \"id\":\"2\", \"type\":\"normal\" },\"email\":\"${user.email}\", \"enabled\":\"true\", \"login\":\"${user.username}\",\"name\":\"${user.username}\",\"password\":\"XXXXX\",\"passwordResetOnLogin\":\"true\",\"role\":{ \"allAssetGroups\":\"false\", \"allSites\":\"false\", \"id\":\"${requestAccessAttributes.get('User_Role')}\", \"superuser\":\"false\"}}",
"httpHeaders": {
"Authorization": "Basic c2F2aXludGFwaXVzZXI6V2VsY29tZUAxMjM="
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
201,
200
]
},
"unsuccessResponses": {
"statusCode": [
400,
401,
403,
404
]
}
}
]
}
Let me know any modifications we need to do for above createaccount json..
05/20/2024 10:32 PM
Its correct format . Please share logs if you facing issue.