This REST API is used to list machines from Machine Resolvers.
The code is tested in tests/test_api_machines
This sets a Machine Token option or deletes it, if the value is empty.
Parameters: |
|
---|
name :param resolver: identify the machine by the machine ID and the resolver name :param serial: identify the token by the serial number :param application: the name of the application like “luks” or “ssh”.
Parameters not listed will be treated as additional options.
Return: |
---|
This fetches the authentication items for a given application and the given client machine.
Parameters: |
|
---|
calculated. In case of the Yubikey this can be a challenge that produces a response. The authentication item is the combination of the challenge and the response.
Parameters: |
|
---|---|
Return: | dictionary with lists of authentication items |
Example response:
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"status": true,
"value": { "ssh": [ { "username": "....",
"sshkey": "...."
}
],
"luks": [ { "slot": ".....",
"challenge": "...",
"response": "...",
"partition": "..."
]
}
},
"version": "privacyIDEA unknown"
}
Attach an existing token to a machine with a certain application.
Parameters: |
|
---|
name :param resolver: identify the machine by the machine ID and the resolver name :param serial: identify the token by the serial number :param application: the name of the application like “luks” or “ssh”.
Parameters not listed will be treated as additional options.
Return: | json result with “result”: true and the machine list in “value”. |
---|
Example request:
POST /token HTTP/1.1
Host: example.com
Accept: application/json
{ "hostname": "puckel.example.com",
"machienid": "12313098",
"resolver": "machineresolver1",
"serial": "tok123",
"application": "luks" }
Return a list of MachineTokens either for a given machine or for a given token.
Parameters: |
|
---|
name :param resolver: Identify the machine by the machine ID and the resolver name :return:
List all machines that can be found in the machine resolvers.
Parameters: |
|
---|
or “id”
Return: | json result with “result”: true and the machine list in “value”. |
---|
Example request:
GET /hostname?hostname=on HTTP/1.1
Host: example.com
Accept: application/json
Example response:
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"status": true,
"value": [
{
"id": "908asljdas90ad0",
"hostname": [ "flavon.example.com", "test.example.com" ],
"ip": "1.2.3.4",
"resolver_name": "machineresolver1"
},
{
"id": "1908209x48x2183",
"hostname": [ "london.example.com" ],
"ip": "2.4.5.6",
"resolver_name": "machineresolver1"
}
]
},
"version": "privacyIDEA unknown"
}
Detach a token from a machine with a certain application.
Parameters: |
|
---|
name :param resolver: identify the machine by the machine ID and the resolver name :param serial: identify the token by the serial number :param application: the name of the application like “luks” or “ssh”.
Return: | json result with “result”: true and the machine list in “value”. |
---|
Example request:
DELETE /token HTTP/1.1
Host: example.com
Accept: application/json
{ "hostname": "puckel.example.com",
"resolver": "machineresolver1",
"application": "luks" }
This fetches the authentication items for a given application and the given client machine.
Parameters: |
|
---|
calculated. In case of the Yubikey this can be a challenge that produces a response. The authentication item is the combination of the challenge and the response.
Parameters: |
|
---|---|
Return: | dictionary with lists of authentication items |
Example response:
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"status": true,
"value": { "ssh": [ { "username": "....",
"sshkey": "...."
}
],
"luks": [ { "slot": ".....",
"challenge": "...",
"response": "...",
"partition": "..."
]
}
},
"version": "privacyIDEA unknown"
}