| 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 |
Namespace: microsoft.graph
[!INCLUDE beta-disclaimer]
Assign a hardware OATH token, represented by a hardwareOathTokenAuthenticationMethodDevice object, to a user. Self-service operations are supported.
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.
[!INCLUDE permissions-table]
[!INCLUDE permissions-table]
[!INCLUDE rbac-authentication-methods-apis-write-others]
Assign a hardware OATH authentication method for yourself.
PUT /me/authentication/hardwareOathMethods/{hardwareOathAuthenticationMethodId}/device/assignTo/$refAssign a hardware OATH authentication method for another user.
PUT /users/{usersId}/authentication/hardwareOathMethods/{hardwareOathAuthenticationMethodId}/device/assignTo/$ref| Name | Description |
|---|---|
| Authorization | Bearer {token}. Required. Learn more about authentication and authorization. |
| Content-Type | application/json. Required. |
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}" |
If successful, this method returns a 204 No Content response code and a user object in the response body.
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]
The following example shows the response.
Note: The response object shown here might be shortened for readability.
HTTP/1.1 204 No Content