I am using Okta C# sdk for development. I have created some custom user profile attributes in the Okta. I am able to create user and save values in custom attributes. But as I saw that when you update profile data you have to provide all the details again. If you provide specific attributes value then sets null for other attributes. So how can I update only one or two attributes so that other should not change.
My code:
var oktaClient = new OktaClient(Apikey, new Uri(ApiUrl));
var usersClient = oktaClient.GetUsersClient();
//var CurrentUser = usersClient.Get("emailid");
foreach (string key in Attributes.Keys)
{
if (CurrentUser.Profile.ContainsProperty(key))
{
//user.Profile.SetProperty(key, Attributes[key]);
CurrentUser.Profile.GetProperty(key);
}
else
{
if (Attributes[key] != null)
CurrentUser.Profile.SetProperty(key, Attributes[key]);
}
}
CurrentUser = usersClient.Update(CurrentUser);
*ERROR:Unable to serialize the object properly