16.1.1.9. Default Realm endpoints¶
These endpoints are used to define the default realm, retrieve it and delete it.
- POST /defaultrealm/(realm)¶
This call sets the default realm.
- Parameters:
realm – the name of the realm, that should be the default realm
- Response JSON Object:
status (bool) – Status of the request
value (integer) – The id of the new default realm
- Request Headers:
PI-Authorization – The authorization token
Example request:
POST /defaultrealm/new_default_realm HTTP/1.1 Host: example.com
Example response:
HTTP/1.1 200 OK Content-Type: application/json { "id": 1, "jsonrpc": "2.0", "result": { "status": true, "value": 1 }, "version": "privacyIDEA unknown" }
- DELETE /defaultrealm¶
This call deletes the default realm.
- Response JSON Object:
status (bool) – Status of the request
value (integer) – The id of the realm which used to be default or
0in case no default realm was found
- Request Headers:
PI-Authorization – The authorization token
Example request:
DELETE /defaultrealm HTTP/1.1 Host: example.com
Example response:
HTTP/1.1 200 OK Content-Type: application/json { "id": 1, "jsonrpc": "2.0", "result": { "status": true, "value": 1 }, "version": "privacyIDEA unknown" }
- GET /defaultrealm¶
This call returns the default realm
- Return:
a json description of the default realm with the resolvers
- Request Headers:
PI-Authorization – The authorization token
Example request:
GET /defaultrealm HTTP/1.1 Host: example.com
Example response:
HTTP/1.1 200 OK Content-Type: application/json { "id": 1, "jsonrpc": "2.0", "result": { "status": true, "value": { "defrealm": { "default": true, "id": 1, "resolver": [ { "name": "defresolver", "node": "", "priority": null, "type": "passwdresolver" } ] } } }, "version": "privacyIDEA unknown" }