fido2AuthenticationMethod: creationOptions

Namespace: microsoft.graph

Important

APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.

Retrieve creation options required to generate and register a Microsoft Entra ID-compatible passkey. Self-service operations aren't supported.

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.

Permission type Least privileged permissions Higher privileged permissions
Delegated (work or school account) UserAuthenticationMethod.ReadWrite.All Not available.
Delegated (personal Microsoft account) Not supported. Not supported.
Application UserAuthenticationMethod.ReadWrite.All Not available.

Important

In delegated scenarios with work or school accounts where the signed-in user is acting on another user, they must be assigned a supported Microsoft Entra role or a custom role with a supported role permission. The following least privileged roles are supported for this operation.

  • Authentication Administrator
  • Privileged Authentication Administrator

HTTP request

GET /users/{user-id}/authentication/fido2Methods/creationOptions(challengeTimeoutInMinutes={challengeTimeoutInMinutes})

Function parameters

The following table lists the parameters that are required when you call this function.

Parameter Type Description
challengeTimeoutInMinutes Int32 Override the timeout of the server-generated challenge returned in the request. The default value is 5 minutes; this value can be overridden to between 5 - 43200 minutes.

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

If successful, this function returns a 200 OK response code and a webauthnCredentialCreationOptions in the response body.

Examples

Request

The following example shows a request.

GET https://graph.microsoft.com/beta/users/{usersId}/authentication/fido2Methods/creationOptions(challengeTimeoutInMinutes=10)

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

{
  "value": {
    "@odata.context": "https://graph.microsoft.com/beta/$metadata#microsoft.graph.webauthnCredentialCreationOptions",
    "challengeTimeoutDateTime": "2024-08-14T16:29:58Z",
    "publicKey": {
        "challenge": "ZXlKaGJHY2lPaUpTVTBFdFQwRkZVQzB5TlRZaUxDSmxibU1pT2lKQk1qVTJSME5OSWl3aWVEVmpJanBiSWsxSlNVUmhSRU5EUVd4...",
        "timeout": 0,
        "attestation": "direct",
        "rp": {
            "id": "login.microsoft.com",
            "name": "Microsoft"
        },
        "user": {
            "id": "T0Y6Ehqp2EfQP0iExdt54DFwdWuaH7qIZbZGpOc92RGnvbXyRPvU-8AOp9r1T7Cebfc3",
            "displayName": "Kim User",
            "name": "kimuser@contoso.com"
        },
        "pubKeyCredParams": [
            {
                "type": "public-key",
                "alg": -7
            },
            {
                "type": "public-key",
                "alg": -257
            }
        ],
        "excludeCredentials": [
            {
                "id": "0S64X8KwFmCeJjHzK1oE/39T+JYhfYbhFurwOxMMjtvRWc/sLYq8AMJVuva823XQ",
                "type": "public-key",
                "transports": []
            },
            {
                "id": "pgIfj2fnom8rJdb4/h1gKqDkq+gxHFksI+m2aR5T+PNNycBfENAM4ksEBvoXky6d",
                "type": "public-key",
                "transports": []
            },
            {
                "id": "u5wuw6SGH0VhAz7OXCLRkCuxhm4UrCB7hcLccyMU6calP1hWexfKe5PJNM69neAM",
                "type": "public-key",
                "transports": []
            },
            {
                "id": "6rc0zTSz2YRlaKlCjqxsNDjDe8qY8TSL95Z4WhxEaaP4XfvfSnAGMk49RSwm/uAO",
                "type": "public-key",
                "transports": []
            }
        ],
        "authenticatorSelection": {
            "authenticatorAttachment": "cross-platform",
            "requireResidentKey": true,
            "userVerification": "required"
        },
        "extensions": {
            "hmacCreateSecret": true,
            "enforceCredentialProtectionPolicy": true,
            "credentialProtectionPolicy": "userVerificationOptional"
        }
    }
  }
}