Skip to content

Latest commit

 

History

History
224 lines (175 loc) · 8.11 KB

File metadata and controls

224 lines (175 loc) · 8.11 KB
title Get authentication states
description Read the properties of a user's authentication method states, such as their sign-in preferences (system-preferred MFA) and per-user MFA state.
author jpettere
ms.reviewer intelligentaccesspm
ms.localizationpriority medium
ms.subservice entra-sign-in
doc_type apiPageType
ms.date 10/22/2024

Get authentication method states

Namespace: microsoft.graph

[!INCLUDE beta-disclaimer]

Read the properties of a user's authentication states. Use this API to retrieve the following information:

[!INCLUDE national-cloud-support]

Permissions

Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.

Permissions to read system-preferred MFA

[!INCLUDE permissions-table]

[!INCLUDE rbac-authentication-methods-apis-read-others]

Permissions to read per-user MFA state

Permissions acting on self

[!INCLUDE permissions-table]

Permissions acting on other users

[!INCLUDE permissions-table]

[!INCLUDE rbac-authentication-methods-policy-apis-read]

HTTP request

To retrieve the sign-in preferences (system-preferred MFA) for a user:

GET /users/{id | userPrincipalName}/authentication/signInPreferences

To retrieve the per-user multifactor authentication state for the signed-in user:

GET /me/authentication/requirements

[!INCLUDE me-apis-sign-in-note]

To retrieve the per-user multifactor authentication state for a user:

GET /users/{id | userPrincipalName}/authentication/requirements

Request headers

Name Description
Authorization Bearer {token}. Required. Learn more about authentication and authorization.

Request body

Don't supply a request body for this method.

Response

For sign-in preferences: If successful, this method returns a 200 OK response code and a signInPreferences object in the response body.

Examples

Example 1: Get a user's system-preferred MFA method

Request

The following example shows a request.

GET https://graph.microsoft.com/beta/users/071cc716-8147-4397-a5ba-b2105951cc0b/authentication/signInPreferences

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]


Response

The following example shows the response.

Note: The response object shown here might be shortened for readability.

HTTP/1.1 200 OK
Content-Type: application/json

{
  "isSystemPreferredAuthenticationMethodEnabled": false,
  "userPreferredMethodForSecondaryAuthentication": "push"
}

Example 2: Get a user's MFA state

Request

The following example shows a request.

GET https://graph.microsoft.com/beta/users/071cc716-8147-4397-a5ba-b2105951cc0b/authentication/requirements

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]


Response

The following example shows the response.

Note: The response object shown here might be shortened for readability.

HTTP/1.1 200 OK
Content-Type: application/json

{
  "perUserMfaState": "enforced"
}