Assign Public Key to User
You can assign a public key to a user with the specified UID and create a new user identity.
Required Privileges
To perform this task, a user must have one of the following roles assigned: Portal Administrator, Service Provider Global Administrator, Service Provider Administrator, Company Owner, Company Administrator.
Request
To assign a public key, send the POST HTTP request to the URL of the /users/{userId}/logins/asymmetricalgorithm resource.
HTTP Request
POST https://<hostname>:1280/api/v3/users/{userId}/logins/asymmetricalgorithm |
Request Headers
The request contains the following headers.
Header | Required/Optional | Value | Description |
Authorization | Required | Bearer <Access-Token> | Authenticates a client who sends the request to the server. Must contain the access token for the current logon session in the Bearer <Access-Token> format. |
Content-Type | Required |
| Identifies a media type that is used in the body of the request. |
Accept | Optional | application/json | Specifies a media type of representation that is required in the response message. If the requested type is not supported, the server will return the response in the application/json media type. |
Request parameters
A list of parameters that are applicable for this operation:
Name | In | Type | Required | Default | Description |
---|---|---|---|---|---|
userId | Path | String (uuid) | Yes | — | UID of a user to whom a public key must be assigned |
description | Query | String | No | — | User identity description |
scopes | Query | Array[string] | No | — | Scopes that are available to the user identity |
Body | Body | String/binary | Yes | — | Public key |
Response
The server returns the following response to the client.
Response Code
A successfully completed operation returns response code 200 OK.
Response Headers
The response to this request contains the following headers. The response may also include additional standard HTTP headers.
Header | Description |
Content-length | The length of the response body. |
Content-type | The media type and syntax of the request body message: application/json; charset=utf-8 |
Response Body
In the response body, Veeam Service Provider Console returns resource representation of a created user identity based on the UserLogin schema.
Example
The following request assigns a public key to a user with UID 36e63b2c-9cf6-4e00-97d0-04195cea501b.
Request: POST https://<hostname>:1280/api/v3/users/36e63b2c-9cf6-4e00-97d0-04195cea501b/logins/asymmetricalgorithm
Request Headers: Content-type: application/octet-stream Authorization: Bearer <Access-Token>
Request Body: <RSAKeyValue><Modulus>urIs1X6dTVF+cQn5DqwDY8mYXYmLqQOlw63IKPh2e+/D0S6gOPc0wshNg2gK/34SLxApR5EHfr3V/+2NaIdXX/1KSaXrX1goJ6oMl6rmEBaHKdqJ/jgWR+h2eyKGfoUOfzKhxqwaSE9hT/iFZJWwuhbweYcYcgcCuhRbXCjNvftrD7gBva40084X/1++b7RrGIrRf3fKbET4Ah+6vPIyNNQ2riy2MLJsvUInvPuF02rZeyrlnv++ThNHm4/R7Er+6odhTGfQK0ViFLeDI8Is8O0DG22oL8MOm+EAuKyunXnBCWpbUTwSxaUNPy9O9NzQ9H1DbVN9ueMMZ0036IasmQ==</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>
Response Code: 200 OK
Response Body: { "data": { "id": 1, "userId": "36e63b2c-9cf6-4e00-97d0-04195cea501b", "userName": "Alpha", "companyId": "49dcc517-a32c-438e-b53d-ee0084dc7feb", "companyName": "Alpha", "identityProviderName": "AA", "description": null, "identifierInProvider": "Alpha", "scopes": [ "integration", "rest", "ui" ], "status": "enabled", "parameters": "", "creationDate": "2020-03-04T00:47:16.5789853+00:00" } } |