Skip to content

Latest commit

 

History

History
111 lines (84 loc) · 3.82 KB

File metadata and controls

111 lines (84 loc) · 3.82 KB
title Assign user a hardware OATH token
description Assign a hardware OATH token to a user.
author luc-msft
ms.localizationpriority medium
ms.subservice entra-sign-in
doc_type apiPageType
ms.date 12/06/2024
toc.title Assign user

Assign user a hardware OATH token

Namespace: microsoft.graph

[!INCLUDE beta-disclaimer]

Assign a hardware OATH token, represented by a hardwareOathTokenAuthenticationMethodDevice object, to a user. Self-service operations are 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.

Permissions acting on self

[!INCLUDE permissions-table]

Permissions acting on another user

[!INCLUDE permissions-table]

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

HTTP request

Assign a hardware OATH authentication method for yourself.

PUT /me/authentication/hardwareOathMethods/{hardwareOathAuthenticationMethodId}/device/assignTo/$ref

Assign a hardware OATH authentication method for another user.

PUT /users/{usersId}/authentication/hardwareOathMethods/{hardwareOathAuthenticationMethodId}/device/assignTo/$ref

Request headers

Name Description
Authorization Bearer {token}. Required. Learn more about authentication and authorization.
Content-Type application/json. Required.

Request body

In the request body, supply a JSON representation of the user object.

You can specify the following properties when creating a user.

Property Type Description
odata.id String A link to the user entity with using objectId as key. Example: "https://graph.microsoft-ppe.com/beta/users/{usersId}"

Response

If successful, this method returns a 204 No Content response code and a user object in the response body.

Examples

Request

The following example shows a request.

PUT https://graph.microsoft.com/beta/users/{usersId}/authentication/hardwareOathMethods/{hardwareOathAuthenticationMethodId}/device/assignTo/$ref
Content-Type: application/json

{
    "@odata.id": "https://graph.microsoft.com/beta/users/0cadbf92-####-####-####-############"
}

[!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 204 No Content