After successfully Authenticated using MSAL. I get the token and passed it on the Flurl. I'm getting 500 error. But if I test it on Postman it works properly. Anything I missed?
Below is my code:
var user = new User
{
AccountEnabled = true,
DisplayName = "Anthony Test",
MailNickname = "AnthonyT",
UserPrincipalName = "AnthonyT@*****.onmicrosoft.com",
PasswordProfile = new PasswordProfile
{
ForceChangePasswordNextSignIn = true,
Password = "xWwvJ]6NMw+bWH-d"
}
};
var result2 = await "https://graph.microsoft.com/v1.0/users".WithHeader("Content-Type", "application/json")
.WithOAuthBearerToken(result.AccessToken)
.PostJsonAsync(user);