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

Azure AD REST Provisioning user attributes not working

Tommil
New Contributor III
New Contributor III

Hello,

 

We have problem with REST connector provisioning to Azure AD. Using the attributes (for example ${user.displayname}) like in the Saviynt documentation is not working but instead it gets sent to AAD like this: "displayName""${user.displayname}",

 

My CreateAccountJSON:

{

  "accountIdPath": "call1.message.id",

  "dateFormat": "yyyy-MM-dd'T'HH:mm:ssXXX",

  "responseColsToPropsMap": {

    "displayName": "call1.message.displayName~#~char",

    "name": "call1.message.userPrincipalName~#~char"

  },

  "call": [

    {

      "name": "call1",

      "connection": "AzureADProvisioning",

      "url": "https://graph.microsoft.com/v1.0/users",

      "httpMethod": "POST",

      "httpParams": "{\"accountEnabled\":true,\"employeeId\":\"11223344\",\"surname\":\"${user.lastname}\",\"givenName\":\"${user.preferedfirstname}\",\"displayName\":\"${user.displayname}\",\"department\":\"${user.companyname}\",\"jobTitle\":\"${user.title}\",\"employeeHireDate\":\"2023-05-30T07:14:21\",\"mailNickname\":\"${user.username}\",\"userPrincipalName\":\"${user.email}\",\"passwordProfile\":{\"forceChangePasswordNextSignIn\":true,\"password\":\"{password}\"},\"usageLocation\":\"FI\"}",

      "httpHeaders": {

        "Authorization": "${access_token}"

      },

      "httpContentType": "application/json",

      "successResponses": {

        "statusCode": [

          200,

          201,

          204,

          205

        ]

      }

    }

This is how it looks in Azure AD:

"value": [

        {

            "accountEnabled": true,

            "mail": null,

            "businessPhones": [],

            "surname": "${user.lastname}",

            "givenName": "${user.preferedfirstname}",

            "displayName""${user.displayname}",

            ...

Any ideas what could be the problem?

Best regards,

Tommi

6 REPLIES 6

sudeshjaiswal
Saviynt Employee
Saviynt Employee

Hello @Tommil,

Seems there is syntax error in your Json, would request you to fix that and try!

Thanks,

If you find the above response useful, Kindly Mark it as "Accept As Solution".

Tommil
New Contributor III
New Contributor III

Hello, 

I now fixed the syntax error:

{
    "accountIdPath": "call1.message.id",
    "dateFormat": "yyyy-MM-dd'T'HH:mm:ssXXX",
    "responseColsToPropsMap": {
        "displayName": "call1.message.displayName~#~char",
        "name": "call1.message.userPrincipalName~#~char"
    },
    "call": [
        {
            "name": "call1",
            "connection": "AzureADProvisioning",
            "url": "https://graph.microsoft.com/v1.0/users",
            "httpMethod": "POST",
            "httpParams": "{\"accountEnabled\":true,\"employeeId\":\"${user.employeeid}\",\"surname\":\"${user.lastname}\",\"givenName\":\"${user.preferedfirstname}\",\"displayName\":\"${user.displayname}\",\"department\":\"${user.companyname}\",\"jobTitle\":\"${user.title}\",\"employeeHireDate\":\"2023-05-30T07:14:21\",\"mailNickname\":\"${user.username}\",\"userPrincipalName\":\"${user.email}\",\"passwordProfile\":{\"forceChangePasswordNextSignIn\":true,\"password\":\"${password}\"},\"usageLocation\":\"FI\"}",
            "httpHeaders": {
                "Authorization": "${access_token}"
            },
            "httpContentType": "application/json",
            "successResponses": {
                "statusCode": [
                    200,
                    201,
                    204,
                    205
                ]
            }
        }
    ]
}
 
But it's still not getting those user attributes from Saviynt.
Any ideas?
 
Thanks,
Tommi

sudeshjaiswal
Saviynt Employee
Saviynt Employee

Hello @Tommil,

You may try the below Json, could you please also share what are you seeing in the logs?
========================================================

{
"accountIdPath": "call1.message.id",
"dateFormat": "yyyy-MM-dd'T'HH:mm:ssXXX",
"responseColsToPropsMap": {
"displayName": "call1.message.displayName~#~char",
"name": "call1.message.userPrincipalName~#~char"
},
"call": [
{
"name": "call1",
"connection": "AzureADProvisioning",
"url": "https://graph.microsoft.com/v1.0/users",
"httpMethod": "POST",
"httpParams": "{\"accountEnabled\":true,\"employeeId\":\"11223344\",\"surname\":\"${user.lastname}\",\"givenName\":\"${user.preferedfirstname}\",\"displayName\":\"${user.displayname}\",\"department\":\"${user.companyname}\",\"jobTitle\":\"${user.title}\",\"employeeHireDate\":\"2023-05-30T07:14:21\",\"mailNickname\":\"${user.username}\",\"userPrincipalName\":\"${user.email}\",\"passwordProfile\":{\"forceChangePasswordNextSignIn\":true,\"password\":\"{password}\"},\"usageLocation\":\"FI\"}",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200,
201,
204,
205
]
}
}
]
}
======================================================

Thanks,

If you find the above response useful, Kindly Mark it as "Accept As Solution".

Tommil
New Contributor III
New Contributor III

Hi @sudeshjaiswal ,

I tested the JSON you provided and received the same error that it's not using the attributes from the user but the notions e.g. ${user.email} instead. There is error that

"The domain portion of the userPrincipalName property is invalid. You must use one of the verified domain names in your organization.","target":"userPrincipalName"}],"

But I have checked that the domain is correct in the user email field. And if I hard code the same value to the JSON instead of using the ${user.email} it works so it's not getting the value correctly from ${user.email} notion.

I attached the logs as you requested.

Edit: Removed the logs file as this got Resolved.

Best regards,

Tommi

 

sudeshjaiswal
Saviynt Employee
Saviynt Employee

Hello @Tommil,

Thanks for sharing the details log and your analysis, it is a binging variable issue,
I have reformatted the json, you may try it now!

=====================================================


{
"accountIdPath": "call1.message.id",
"dateFormat": "yyyy-MM-dd'T'HH:mm:ssXXX",
"responseColsToPropsMap": {
"displayName": "call1.message.displayName~#~char",
"name": "call1.message.userPrincipalName~#~char"
},
"call": [
{
"name": "call1",
"connection": "AzureADProvisioning",
"url": "https://graph.microsoft.com/v1.0/users",
"httpMethod": "POST",
"httpParams": "{\"accountEnabled\":true,\"employeeId\":\"11223344\",\"surname\":\"${user.lastname}\",\"givenName\":\"${user.preferedFirstName}\",\"displayName\":\"${user.displayname}\",\"department\":\"${user.companyname}\",\"jobTitle\":\"${user.title}\",\"employeeHireDate\":\"2023-05-30T07:14:21\",\"mailNickname\":\"${user.username}\",\"userPrincipalName\":\"${user.email}\",\"passwordProfile\":{\"forceChangePasswordNextSignIn\":true,\"password\":\"${password}\"},\"usageLocation\":\"FI\"}",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200,
201,
204,
205
]
}
}
]
}
======================================================

For Ref:- https://docs.saviyntcloud.com/bundle/AzureAD-v23x/page/Content/Configuring-the-Integration-for-Provi... 

Thanks,

If you find the above response useful, Kindly Mark it as "Accept As Solution".

Tommil
New Contributor III
New Contributor III

Hi,

Yes the problem was with this as it was case sensitive: \"givenName\":\"${user.preferedFirstName}

It works now, thanks!

-Tommi