
VinodhM.45873 (Customer) asked a question.
Hello
We have 100's of thousands of user in Okta. We have a custom user profile attribute configured in Okta called "digital_home_user_id". This maps to a user id from an internal applications. This value is not set properly for 30% of the user in our Okta. And this has become a mandatory attribute recently. So, here is what we want to do.
1) Use the .Net (C*) Okta API to get the user list. Either using GetUserAsync or ListUsers.
2) Check the Custom attribute called "digital_home_user_id" to see if it has a value.
3) If it is null or empty (for a user), then get the corresponding value from the internal system and update Okta.
However, the problem is, the user profile doesn't include the custom attributes. So, "digital_home_user_id" does not exist in the response.
Question:
How to get the custom attribute and update the value using Okta's .Net API?
I browsed through a lot of similar questions, but none has any helpful answers. Appreciate any help you could provide.
Thanks,
Vinodh

Hello Vinodh,
When you state,
the user profile doesn't include the custom attributes. So, "digital_home_user_id" does not exist in the response
I assume the Okta user type has a custom attribute "digital_home_user_id" setup, but from within the .NET Management SDK there is not Get/Set field for the custom attribute?
Assuming the above it true, if you want to set a custom attribute from the .NET SDK you could do something like,
var foundUsers = await client.Users
.ListUsers(search: $"profile.login eq \"igor.dean3@mail.com\"")
.ToArrayAsync();
var digital_home_user_id = foundUsers.First().Profile.GetProperty<String>("digital_home_user_id");
Console.WriteLine("digital_home_user_id=" + digital_home_user_id);
if (digital_home_user_id == null || digital_home_user_id.Equals("")) {
foundUsers.First().Profile.SetProperty("digital_home_user_id", "My Digital Id");
await foundUsers.First().UpdateAsync();
}