Quick FYI. I ran into the same problem using the Microsoft Graph SDK PowerShell module (New-MgUserAuthinticationPhoneMethod). What I discovered in this use-case is that the error only occurs when you attempt to add the authentication method to the same account that is authenticated through PowerShell. This occurs even though the self-target scope "UserAuthenticationMethod.ReadWrite" as well as the all users scope "UserAuthenticationMethod.ReadWrite.All" were both added to the session. However, if you attempt the same command against another user account, it succeeds.
phoneAuthenticationMethod API returning unauthenticated
Hamza Jeljeli
1
Reputation point
Hello There,
I've been trying to Create a new phoneAuthenticationMethod using the phoneAuthenticationMethod resource in Microsoft Graph API using the documentation found in this link : https://learn.microsoft.com/en-us/graph/api/authentication-post-phonemethods?view=graph-rest-beta&tabs=http . When i try to add a new phone number (using Graph Explorer for example), it returns the following error :
{
"error": {
"code": "unauthenticated",
"message": "The calling app is not authenticated.",
"innerError": {
"message": "The calling app is not authenticated.",
"date": "2021-03-29T10:08:51",
"request-id": "7ca15ea3-d605-43d6-9fbe-acbb0d609898",
"client-request-id": "5a77eccd-d7e7-cff2-eee1-a29094d86ba8"
}
}
}
Permissions for the use of the API are already consented;
Any help is much appreciated !
Microsoft Security Microsoft Entra Microsoft Entra ID
25,081 questions