-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
- with the users API, add an API to create a new user with an anon-xx username with B2C
- add this option to the Blazor client
- create background functionality to cleanup non-active anon users when not active for TBD days
This should be possible with Graph (CoPilot):
using Microsoft.Graph;
using Microsoft.Identity.Client;
var clientId = "YOUR_CLIENT_ID";
var clientSecret = "YOUR_CLIENT_SECRET";
var tenantId = "YOUR_TENANT_ID";
IConfidentialClientApplication confidentialClientApplication = ConfidentialClientApplicationBuilder
.Create(clientId)
.WithTenantId(tenantId)
.WithClientSecret(clientSecret)
.Build();
ClientCredentialProvider authProvider = new ClientCredentialProvider(confidentialClientApplication);
GraphServiceClient graphClient = new GraphServiceClient(authProvider);
var user = new User
{
AccountEnabled = true,
DisplayName = "John Doe",
MailNickname = "johndoe",
UserPrincipalName = "[email protected]",
PasswordProfile = new PasswordProfile
{
ForceChangePasswordNextSignIn = true,
Password = "TempP@ssw0rd!"
}
};
await graphClient.Users
.Request()
.AddAsync(user);
But don't require a password change!
Metadata
Metadata
Assignees
Labels
No labels