Here is my request on Microsoft graph explorer , same input same error.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Already given these permissions.
User.ReadWrite.All, Directory.ReadWrite.All , Directory.AccessAsUser.All
My User is as per this.
var newUserWithMultippleIdentity = new User
{
DisplayName = "Riki Joe",
Identities = new List<ObjectIdentity>()
{
new ObjectIdentity
{
SignInType = "userName",
Issuer = "btrikas.onmicrosoft.com",
IssuerAssignedId = "johnsmith"
},
new ObjectIdentity
{
SignInType = "emailAddress",
Issuer = "btrikas.onmicrosoft.com",
IssuerAssignedId = "******@gmail.com"
},
},
PasswordProfile = new PasswordProfile
{
Password = "xWwvJ]6NMw+bWH-d",
ForceChangePasswordNextSignIn = false,
},
PasswordPolicies = "DisablePasswordExpiration"
};
var graphServiceClnt = _startup.CreateTenant(tenant, scopesUserCreate);
var secureStringPassword = _helper.getSecureString("", password);
User newUser = await graphServiceClnt.Users
.Request()
.AddAsync(user);
I tried with this user but it was asking me to give values to following properties too.
AccountEnabled = true,
MailNickname = "RikiJo",
CreationType = "LocalAccount",
UserPrincipalName = "******@btrikas.onmicrosoft.com",
still the error comes saying "Some properties are missing" but not mentioned specifically what's missing.
Did as per documentation but nothing works ? please help me.
Here is my request on Microsoft graph explorer , same input same error.
After many tests, I reproduced and solved your problem. The problem appears on the issuer
attribute. Since you are creating a local Azure AD B2C user, please note that this is not an Azure AD user, so you must log in with the administrator account of the Azure ad b2c tenant to graph explorer, and then you need to set the issuer
to the domain of the Azure ad b2c tenant.
code:
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var user = new User
{
DisplayName = "{displayName}",
CreationType = "LocalAccount",
Identities = new List<ObjectIdentity>()
{
new ObjectIdentity
{
SignInType = "userName",
Issuer = "{azure ad b2c tenant domain}",
IssuerAssignedId = "johnsmithtest1"
}
},
PasswordProfile = new PasswordProfile
{
Password = "{Password}",
ForceChangePasswordNextSignIn = false
},
PasswordPolicies = "DisablePasswordExpiration"
};
await graphClient.Users
.Request()
.AddAsync(user);
If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.