Okta SDK Create Users with Profile Custom fields

api

#1

how to Create Users with Profile Custom fields using Okta SDK ?
in visual studio?
var user = new User()
{
Profile = new UserProfile
{
FirstName = oktaDataUser.FirstName,
LastName = oktaDataUser.LastName,
Email = oktaDataUser.PrimaryEmail,
Login = oktaDataUser.UserName,
SecondEmail = oktaDataUser.SecondaryEmail
},
Credentials = new UserCredentials
{
Password = new PasswordCredential { Value = oktaDataUser.Password }
}
};
try
{
user.Profile.SetProperty(“customfield1”, oktaDataUser.customfield1);
user.Profile.SetProperty(“customfield2”, oktaDataUser.customfield2);
var createdUser = await usersClient.CreateUserAsync(user, true, false, UserNextLogin.ChangePassword);
foreach (var group in oktaDataUser.Groups)
{
await createdUser.AddToGroupAsync(group);
}
_log.InfoFormat(createdUser.ToString());
}