Issue with Enabling Phone Method for Azure AD B2C User via Graph API #2549
Labels
Status: No recent activity
status:waiting-for-author-feedback
Issue that we've responded but needs author feedback to close
type:bug
A broken experience
Describe the bug
I am currently working on enabling the phone method for Azure AD B2C users using the Graph API, specifically using the PhoneMethods for authentication. However, I am encountering an issue where the operation fails with the error message: "Cannot enable SMS sign-in on phone auth method as the credential policy is not enabled on user".
Expected behavior
Phone method should be add to the user.
How to reproduce
`if (adUser != null)
{
var phoneMethods = graphClient.Users[adUser.Id].Authentication.PhoneMethods.GetAsync().Result;
}
catch (Exception exp)
{
Console.WriteLine($"Exception Caught: {exp.Message}");
}`
SDK Version
5.56.0
Latest version known to work for scenario above?
No response
Known Workarounds
No response
Debug output
Click to expand log
```Microsoft.Graph.Models.ODataErrors.ODataError: Can not enable Sms sign in on phone auth method as the credential policy is not enabled on user.
at Microsoft.Kiota.Http.HttpClientLibrary.HttpClientRequestAdapter.ThrowIfFailedResponse(HttpResponseMessage response, Dictionary
2 errorMapping, Activity activityForAttributes, CancellationToken cancellationToken) at Microsoft.Kiota.Http.HttpClientLibrary.HttpClientRequestAdapter.SendNoContentAsync(RequestInformation requestInfo, Dictionary
2 errorMapping, CancellationToken cancellationToken)at Microsoft.Kiota.Http.HttpClientLibrary.HttpClientRequestAdapter.SendNoContentAsync(RequestInformation requestInfo, Dictionary
2 errorMapping, CancellationToken cancellationToken) at Microsoft.Graph.Users.Item.Authentication.PhoneMethods.Item.EnableSmsSignIn.EnableSmsSignInRequestBuilder.PostAsync(Action
1 requestConfiguration, CancellationToken cancellationToken)at Program.Main(String[] args) in C:\Projects\GraphClient\Program.cs:line 76
The text was updated successfully, but these errors were encountered: