Skip to main content
Version: 1.12.6.x LTS

Examples

The examples represent requests to nevisMeta with Ninja configured in development mode. If Ninja is configured in production mode, valid cookies must be provided for each request.All examples represent possibleJSONresponses.**

Setups

Get all setups

Request

curl -X GET -u admin:ninja https://localhost:9943/nevismeta/rest/v2/modules/oauthv2/setups/

Response

{
"setupIds": [
"4b471efb4f97f45f868d4bcaaed70230",
"0e47709a56cde0ef462908c1b519a4de",
"bfb5b1bcf6720edcc9445e6b1b2da571",
"267ab3ff377f438e40a814e76849578a",
"e4af485e29af1572aacd0e5653c68b69"
]
}

Create setup

Minimal setup request

curl -X POST -u admin:ninja
https://localhost:9943/nevismeta/rest/v2/modules/oauthv2/setups/
-d '{
"name": "MINIMAL-Name",
"client_defaults": {
"force_reauthentication": false,
"access_token_ttl": 3600,
"refresh_token_ttl": 15552000,
"id_token_ttl": 3600,
"persisted_consent_ttl": 31104000,
"grant_types": []
},
"resource_server_defaults": {
"scope_policy_implicit_flow": "consent_required",
"scope_policy_authorization_code_flow": "consent_required",
"scope_policy_refresh_token": "consent_required",
"scope_policy_force_reauthentication": false
}
}'

Response

{
"setupId": "e4af485e29af1572aacd0e5653c68b69"
}

Clients

Get all clients

Request

curl -X GET -u admin:ninja
https://localhost:9943/nevismeta/rest/v2/modules/oauthv2/setups/34e54c81e76b517d63e49972de73fda0/clients/

Response

{
"clientIds": [
"27eee824a8d31358f27a591a41bf0791",
"8a9228fbb3f1a7207b39c86fe4500b35",
"b19018d155210b5ccf974fabee02c1bf"
]
}

Create client

Minimal client request

curl -X POST -u admin:ninja
https://localhost:9943/nevismeta/rest/v2/modules/oauthv2/setups/34e54c81e76b517d63e49972de73fda0/clients
-d '{
"name": "MINIMAL",
"confidentiality_type": "public"
}'

Response

{
"clientId": "5d752a1a1541959c4732de8c9d0d4bca"
}

Resource servers

Get all resource servers

Request

curl -X GET -u admin:ninja
https://localhost:9943/nevismeta/rest/v2/modules/oauthv2/setups/34e54c81e76b517d63e49972de73fda0/resource-servers

Response

{
"resourceServerIds": [
"cf171b61ab6c699c5eba3e090a13a8ce",
"bea25124ed54529c15414eddbc171371",
"576e086abd1c646fc861aa59fc38bf10",
"18b66ed025d96e3a6d96ad9759445e72"
]
}

Create resource server

Minimal resource server request

curl -X POST -u admin:ninja
https://localhost:9943/nevismeta/rest/v2/modules/oauthv2/setups/34e54c81e76b517d63e49972de73fda0/resource-servers
-d '{
"name": "MINIMAL",
"scopes": [
{
"name": "scope-a"
}
]
}'

Response

{
"resourceServerId": "bea25124ed54529c15414eddbc171371"
}

Snapshots

Get all snapshots of the setup valid at 2019-05-17T11:29:25.843

curl -X GET  -u admin:ninja
'https://localhost:9943/nevismeta/rest/v2/modules/oauthv2/setups/34e54c81e76b517d63e49972de73fda0/snapshots?validAt=2019-05-17T11:29:25.843'

Get all snapshots

curl -X GET  -u admin:ninja
'https://localhost:9943/nevismeta/rest/v2/modules/oauthv2/setups/34e54c81e76b517d63e49972de73fda0/snapshots

Response

{
"snapshotIds": [
"a6639f84b84021c55699ccc9e86f7d2a"
]
}