Manage users' authentication methods using Microsoft Graph' - Microsoft Graph (2024)

  • Article

Authentication methods are the ways that users authenticate in Microsoft Entra ID. The following authentication methods are available in Microsoft Entra ID today and are manageable through Microsoft Graph:

  • Windows Hello for Business
  • Microsoft Authenticator
  • FIDO2 security key
  • Certificate-based authentication
  • OATH hardware tokens (preview)
  • OATH software tokens
  • Temporary Access Pass (TAP)
  • SMS
  • Voice
  • Password

Authentication methods are used in primary, second-factor, and step-up authentication, and also in the self-service password reset (SSPR) process.

What can you do with the authentication methods APIs?

You can use the authentication method APIs to integrate to your apps for managing a user's authentication methods. For example, you can:

  • Add a phone number for a user, who can then use that number for SMS and voice call authentication if they're enabled to use it by policy
  • Update or delete the phone number assigned to a user
  • Enable or disable the number for SMS sign-in
  • Reset a user's password

Important

We don't recommend using the authentication methods APIs for scenarios where you need to iterate over your entire user population for auditing or security check purposes. For these types of scenarios, we recommend using the authentication method registration and usage reporting APIs (some APIs are available on the beta endpoint only).

Use policies to manage authentication methods in your tenant

You can choose what authentication methods are allowed for users in your tenant by configuring authentication method policies. For each policy, you configure whether the authentication method is enabled, its settings, and can explicitly define the groups of users that are allowed or not allowed to use the method.

Sample scenario

In this article, you learn how to:

  • Authenticate to Microsoft Entra ID with the right roles and permissions
  • Check the user's authentication methods
  • Add new phone numbers for the user
  • Remove a phone number from the user
  • Reset the user's password

Step 1: Authenticate to Microsoft Entra ID with the right roles and permissions

Sign in to an API client such as Graph Explorer with an account that has at least the Privileged Authentication Administrator or Authentication Administrator Microsoft Entra role. You can use a test tenant with sample data to try out the APIs.

Next, grant the app the UserAuthenticationMethod.ReadWrite.All permission. You need this permission to perform both the read and write operations in this scenario.

You can now start using the APIs. In this scenario, you use the APIs to manage Cameron White's authentication methods.

Step 2: Check the user's authentication methods

Request

  • HTTP
  • C#
  • CLI
  • Go
  • Java
  • JavaScript
  • PHP
  • PowerShell
  • Python
GET https://graph.microsoft.com/v1.0/users/CameronW@Contoso.com/authentication/methods

Response

From this response, Cameron has only the password authentication method enabled. 28c10230-6103-485e-b985-444c60001490 is the globally unique ID of the password authentication method across Microsoft Entra ID.

HTTP/1.1 200 OKContent-type: application/json{ "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('CameronW%40contoso.com')/authentication/methods", "@microsoft.graph.tips": "Use $select to choose only the properties your app needs, as this can lead to performance improvements. For example: GET users('<key>')/authentication/methods?$select=id", "value": [ { "@odata.type": "#microsoft.graph.passwordAuthenticationMethod", "id": "28c10230-6103-485e-b985-444c60001490", "password": null, "createdDateTime": "2023-09-18T10:38:07Z" } ]}

Step 3: Add new phone numbers for the user

In this step, you add a new mobile phone number for Cameron to use.

Request

  • HTTP
  • C#
  • CLI
  • Go
  • Java
  • JavaScript
  • PHP
  • PowerShell
  • Python
POST https://graph.microsoft.com/v1.0/users/CameronW@Contoso.com/authentication/phoneMethodsContent-Type: application/json{ "phoneNumber": "+1 2065555555", "phoneType": "mobile"}

Response

HTTP/1.1 200 OKContent-type: application/json{ "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('CameronW%40contoso.com')/authentication/phoneMethods/$entity", "id": "3179e48a-750b-4051-897c-87b9720928f7", "phoneNumber": "+1 2065555555", "phoneType": "mobile", "smsSignInState": "notAllowedByPolicy"}

Run the same request, adding an office phoneType.

Step 4: Verify the user's authentication methods

Request

  • HTTP
  • C#
  • CLI
  • Go
  • Java
  • JavaScript
  • PHP
  • PowerShell
  • Python
GET https://graph.microsoft.com/v1.0/users/CameronW@Contoso.com/authentication/methods

Response

HTTP/1.1 200 OKContent-type: application/json{ "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('CameronW%40contoso.com')/authentication/methods", "@microsoft.graph.tips": "Use $select to choose only the properties your app needs, as this can lead to performance improvements. For example: GET users('<key>')/authentication/methods?$select=id", "value": [ { "@odata.type": "#microsoft.graph.phoneAuthenticationMethod", "id": "e37fc753-ff3b-4958-9484-eaa9425c82bc", "phoneNumber": "+1 4255550199", "phoneType": "office", "smsSignInState": "notSupported" }, { "@odata.type": "#microsoft.graph.phoneAuthenticationMethod", "id": "3179e48a-750b-4051-897c-87b9720928f7", "phoneNumber": "+1 2065555555", "phoneType": "mobile", "smsSignInState": "notAllowedByPolicy" }, { "@odata.type": "#microsoft.graph.passwordAuthenticationMethod", "id": "28c10230-6103-485e-b985-444c60001490", "password": null, "createdDateTime": "2023-09-18T10:38:07Z" } ]}

Confirm that you can see both numbers as expected. The IDs of the different phone number types are globally the same across Microsoft Entra ID as follows:

  • b6332ec1-7057-4abe-9331-3d72feddfe41 for alternateMobile phone type
  • e37fc753-ff3b-4958-9484-eaa9425c82bc for office phone type
  • 3179e48a-750b-4051-897c-87b9720928f7 for mobile phone type

Step 5: Remove a phone number from the user

Cameron is now working from home so you need to remove the office number from his account.

  • HTTP
  • C#
  • CLI
  • Go
  • Java
  • JavaScript
  • PHP
  • PowerShell
  • Python
DELETE https://graph.microsoft.com/v1.0/users/CameronW@Contoso.com/authentication/phoneMethods/e37fc753-ff3b-4958-9484-eaa9425c82bc

The request returns a 204 No Content response code. To verify that the office phone method was removed from Cameron's account, rerun the request in Step 4. Cameron should now have only the mobile phone and password authentication methods.

Step 6: Reset the user's password

Cameron has forgotten their password and you need to reset it for them. You can reset a user's password and specify a temporary password, or you can let Microsoft Entra ID generate a temporary password.

In both methods, the response includes a Location header with a URL you can use to check the status of the operation via a GET operation. The reset operation doesn't complete immediately as Microsoft Entra ID needs to sync the password, including down to Active Directory in the tenant's on-premises infrastructure (for on-premises users). The URL is valid for 24 hours.

Option 1: Reset the user's password and supply a temporary new password

Request

  • HTTP
  • C#
  • CLI
  • Go
  • Java
  • JavaScript
  • PHP
  • PowerShell
  • Python
POST https://graph.microsoft.com/v1.0/users/CameronW@Contoso.com/authentication/passwordMethods/28c10230-6103-485e-b985-444c60001490/resetPasswordContent-Type: application/json{ "newPassword": "29sdjfw#fajsdA_a_3an3223"}

Response

HTTP/1.1 202 AcceptedLocation: https://graph.microsoft.com/v1.0/users/a87cc624-b550-4559-b934-3bc0325a4808/authentication/operations/cc8e9b0e-7495-47f2-ad4a-3daa966543c6?aadgdc=DUB02P&aadgsu=ssprprod-a

Option 2: Reset the user's password and let Microsoft Entra ID generate a temporary new password

In this request, you don't provide a new password and instead let Microsoft Entra ID generate a password and return it in the response.

POST https://graph.microsoft.com/v1.0/users/CameronW@Contoso.com/authentication/passwordMethods/28c10230-6103-485e-b985-444c60001490/resetPassword

Response

HTTP/1.1 202 AcceptedLocation: https://graph.microsoft.com/v1.0/users/a87cc624-b550-4559-b934-3bc0325a4808/authentication/operations/ba0c9a11-5163-4353-89ba-81501617ede0?aadgdc=AM4P&aadgsu=ssprprod-aContent-Type: application/json{ "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#microsoft.graph.passwordResetResponse", "newPassword": "Hopu0277"}

Check the status of the password reset operation

Request

  • HTTP
  • C#
  • CLI
  • Go
  • Java
  • JavaScript
  • PHP
  • PowerShell
  • Python
GET https://graph.microsoft.com/v1.0/users/a87cc624-b550-4559-b934-3bc0325a4808/authentication/operations/ba0c9a11-5163-4353-89ba-81501617ede0?aadgdc=AM4P&aadgsu=ssprprod-a

Response

HTTP/1.1 202 Accepted{ "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('a87cc624-b550-4559-b934-3bc0325a4808')/authentication/operations/$entity", "@microsoft.graph.tips": "Use $select to choose only the properties your app needs, as this can lead to performance improvements. For example: GET users('<guid>')/authentication/operations('<guid>')?$select=createdDateTime,lastActionDateTime", "id": "ba0c9a11-5163-4353-89ba-81501617ede0", "createdDateTime": "2024-01-18T16:37:10Z", "lastActionDateTime": "2024-01-18T16:37:10Z", "status": "succeeded", "statusDetail": "ResetSuccess", "resourceLocation": "https://graph.microsoft.com/v1.0/users/a87cc624-b550-4559-b934-3bc0325a4808/authentication/methods/28c10230-6103-485e-b985-444c60001490"}

API reference

Looking for the API reference for authentication methods?

  • See Microsoft Entra authentication methods API overview
  • See the Microsoft Entra authentication methods policies API reference
Manage users' authentication methods using Microsoft Graph' - Microsoft Graph (2024)
Top Articles
Frequently Asked Questions - Mazon Associates
How to Clean and Season a Cast-Iron Pan | Cook's Illustrated
Heat Pump Repair Horseshoe Bay Tx
Carmel.clay Schools Calendar
Fhsd Lunch Menu
Julian Sands Shirtless
1968 Subaru Invader Gt
Deranged Wojak
Holiday Gift Bearer In Egypt
What Happened To Athena Palomino
Funny Spotify Playlist Covers 300X300
Todoroki Oc
Inside Teresa Giudice & Luis Ruelas' $3.3 Million New Jersey House
Transcripts - University of Phoenix
Craigslist Akron Canton Ohio
Trejo's Blanchard Menu
‘This is going to be different. It’ll be exclusive.’ JetBlue announces plans to open luxury lounge at Logan. - The Boston Globe
80 For Brady Showtimes Near Cinemark At Harlingen
Dekalb County Jail Fort Payne Alabama
Sam's Club Gas Price Annapolis
BERNZOMATIC TS4000 INSTRUCTION MANUAL Pdf Download
Subway Surfers Unblocked Wtf
Umbreon GX #SM36 Prices | Pokemon Promo
Reiseland Brandenburg: Ihr Portal für Urlaub und Ausflüge
Newcardapply.com/21978
Used Trolling Motors For Sale Craigslist
27L1576
Game Like Tales Of Androgyny
What is God Saying To YOU Today?
Hardage Giddens Chapel Hills Obituaries
Remember those moving, 3D portraits from Harry Potter? They’re a real thing now! - Yanko Design
On the hunt for an apartment? Try these 9 Craigslist alternatives
Crime Graphics Tcsd
belarus studio│bingサジェスト検索結果履歴│
Gabrielle Abbate Obituary
Weil Cornell Connect
Octagonal Pyramid Surface Area Calculator
Fab Pedigree
Uh Board Of Regents Meeting
Clothes Mentor Arlington Texas
Creepshotorg
3rd Age Felling Axe / Third Age Felling Axe [High Level Delivery!... | ID 217153061 | PlayerAuctions
Huron County Jail, OH Inmate Search: Roster & Mugshots
Depew Garbage Schedule 2023
Nyu Paralegal Program
Tupperware Containers Ebay
Craigslist Apartments In Philly
Dr. David Oualaalou Ethnicity
Pokemon Mmo Rom
First Mess Blog
Latest Posts
Article information

Author: Van Hayes

Last Updated:

Views: 6310

Rating: 4.6 / 5 (46 voted)

Reviews: 85% of readers found this page helpful

Author information

Name: Van Hayes

Birthday: 1994-06-07

Address: 2004 Kling Rapid, New Destiny, MT 64658-2367

Phone: +512425013758

Job: National Farming Director

Hobby: Reading, Polo, Genealogy, amateur radio, Scouting, Stand-up comedy, Cryptography

Introduction: My name is Van Hayes, I am a thankful, friendly, smiling, calm, powerful, fine, enthusiastic person who loves writing and wants to share my knowledge and understanding with you.