2 REST Specifications for Non OCI Deployment
This chapter provides information about REST specifications used in Oracle Communications Cloud Native Configuration Console.
For HELM configurations, see Oracle Communications Cloud Native Configuration Console Installation, Upgrade, and Fault Recovery Guide.
For the configurations using CNC Console, see Oracle Communications Cloud Native Configuration Console User Guide.
Note:
- You can also refer to
occncc_configuration_openapi_<version>.json(included in the CNCC package). It contains the full REST API specification, including endpoints, parameters, request/response schemas, and error responses. - The examples in this documentation use the
cnccrealm by default. To perform the same operations on the default realm, replacecnccwithmasterin all URI paths and request payloads.
2.1 Generate access token
CNC Console uses Generate access token REST API to generate
the access token.
Type: POST
URI:
POST /{realm}/protocol/openid-connect/token Table 2-1 Request Body Parameters
| Type | Field Name | Data Type | Description |
|---|---|---|---|
| Body | client_id | string | Name of the client |
| Body | username | string | Login Username |
| Body | password | string | Login Password |
| Body | grant_type | string | Type of Authorization used |
Sample URI:
http://${cncc-iam-ingress-extrenal-ip}:${cncc-iam-ingress-service-port}/cncc/auth/realms/master/protocol/openid-connect/token
Example curl command:
curl --location --request POST 'http://${cncc-iam-ingress-extrenal-ip}:${cncc-iam-ingress-service-port}/cncc/auth/realms/master/protocol/openid-connect/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'client_id=admin-cli' \
--data-urlencode 'username=admin' \
--data-urlencode 'password=xxxxxx' \
--data-urlencode 'grant_type=password'Example of the Request Body
The following is the example of the request body:
{
"client_id":"admin-cli",
"username": "admin",
"password": "<Password Value>",
"grant_type": "password",
} Example of the Response Body
{
"access_token": "eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lGMfag",
"expires_in": 60,
"refresh_expires_in": 1800,
"refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCIgOiAiSldUIiwia2lkICIxM"
"not-before-policy": 0,
"session_state": "52dd8d7c-f8d9-4009-9c34-0262bb7d3722",
"scope": "email profile"
}Table 2-2 Supported Response Codes
| Code | Description |
|---|---|
| 200 OK | Access token generated. |
| 400 Bad Request | Bad Request |
| 401 Unauthorized | Invalid user credentials |
| 404 Not Found | Realm not found |
| 500 Internal Server Error | Internal Server Error |
2.2 Create a new user
CNC Console uses Create a new user REST API to create a new user.
The user name must be unique.
Type: POST
URI:
POST /{realm}/users
Table 2-3 Request Body Parameters
| Type | Field Name | Data Type | Mandatory(M)/Optional(O)/Conditional(C) | Description |
|---|---|---|---|---|
| Body | username | string | M | Name of user to be created. |
Sample URI:
http://${cncc-iam-ingress-extrenal-ip}:${cncc-iam-ingress-service-port}/cncc/admin/auth/admin/realms/cncc/users
Example curl command:
{curl --location --request POST 'http://${cncc-iam-ingress-extrenal-ip}:${cncc-iam-ingress-service-port}/cncc/admin/auth/admin/realms/cncc/users' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{ "enabled": true,
"username": "user6"}'Example of the Request Body
The following is the example of the request body:
{ "username": "user6"}Example of the Response Code
The following is the example of the response code:
201 CreatedTable 2-4 Supported Response Codes
| Code | Description |
|---|---|
| 201 Created | Create a new user. Username must be unique. {Requires payload} |
| 400 Bad Request | Bad Request |
| 401 Unauthorized | Missing Authentication |
| 403 Forbidden | Forbidden |
| 404 Not Found | Realm not found |
| 409 Conflict | User exists with the same username |
| 500 Internal Server Error | Internal Server Error |
2.3 Get Users
CNC Console uses Get users REST API to return a list of
users.
Type: GET
URI:
GET /{realm}/users
http://${cncc-iam-ingress-extrenal-ip}:${cncc-iam-ingress-service-port}/cncc/auth/admin/realms/cncc/users
curl --location --request GET 'http://${cncc-iam-ingress-extrenal-ip}:${cncc-iam-ingress-service-port}/cncc/auth/admin/realms/cncc/users' \
--header 'Authorization: Bearer <token>' Example of the Response Body
The following is the example of the response body:
[
{
"id": "aa1adf75-7b59-43c1-8405-e0fd8b43d734",
"username": "user",
"firstName": "CNCC",
"lastName": "user",
"email": "user@example.com",
"emailVerified": true,
"attributes": {
"department": [
"CNCC"
]
},
"userProfileMetadata": {
"attributes": [
{
"name": "username",
"displayName": "${username}",
"required": true,
"readOnly": true,
"validators": {
"username-prohibited-characters": {
"ignore.empty.value": true
},
"multivalued": {
"max": "1"
},
"length": {
"max": 255,
"ignore.empty.value": true,
"min": 3
},
"up-username-not-idn-homograph": {
"ignore.empty.value": true
}
},
"multivalued": false
},
{
"name": "email",
"displayName": "${email}",
"required": false,
"readOnly": false,
"validators": {
"multivalued": {
"max": "1"
},
"length": {
"max": 255,
"ignore.empty.value": true
},
"email": {
"ignore.empty.value": true
}
},
"multivalued": false
},
{
"name": "firstName",
"displayName": "${firstName}",
"required": false,
"readOnly": false,
"validators": {
"person-name-prohibited-characters": {
"ignore.empty.value": true
},
"multivalued": {
"max": "1"
},
"length": {
"max": 255,
"ignore.empty.value": true
}
},
"multivalued": false
},
{
"name": "lastName",
"displayName": "${lastName}",
"required": false,
"readOnly": false,
"validators": {
"person-name-prohibited-characters": {
"ignore.empty.value": true
},
"multivalued": {
"max": "1"
},
"length": {
"max": 255,
"ignore.empty.value": true
}
},
"multivalued": false
}
],
"groups": [
{
"name": "user-metadata",
"displayHeader": "User metadata",
"displayDescription": "Attributes, which refer to user metadata"
}
]
},
"enabled": true,
"createdTimestamp": 1764569865712,
"totp": false,
"disableableCredentialTypes": [],
"requiredActions": [],
"notBefore": 0,
"access": {
"manage": true
}
}
,
.....
]Table 2-5 Supported Response Codes
| Code | Description |
|---|---|
| 200 OK | OK |
| 400 Bad Request | Bad Request |
| 401 Unauthorized | Missing Authentication |
| 403 Forbidden | Forbidden |
| 404 Not Found | Realm not found |
| 500 Internal Server Error | Internal Server Error |
2.4 Retrieve Specific User Information by Username
CNC Console uses Get REST API to retrieve specific user
information by username.
Type: GET
URI:
GET /{realm}/users?username={username}Table 2-6 Request Path Parameters
| Type | Field Name | Data Type | Description |
|---|---|---|---|
| Path | username | string | Username of user. |
http://${cncc-iam-ingress-extrenal-ip}:${cncc-iam-ingress-service-port}/cncc/auth/admin/realms/cncc/users?username=usercurl --location --request GET 'http://${cncc-iam-ingress-extrenal-ip}:${cncc-iam-ingress-service-port}/cncc/auth/admin/realms/cncc/users?username=user' \
--header 'Authorization: Bearer <token>'Example of the Response Body
The following is the example of the response body:
[
[
{
"id": "aa1adf75-7b59-43c1-8405-e0fd8b43d734",
"username": "user",
"firstName": "CNCC",
"lastName": "user",
"email": "user@example.com",
"emailVerified": true,
"attributes": {
"department": [
"CNCC"
]
},
"userProfileMetadata": {
"attributes": [
{
"name": "username",
"displayName": "${username}",
"required": true,
"readOnly": true,
"validators": {
"username-prohibited-characters": {
"ignore.empty.value": true
},
"multivalued": {
"max": "1"
},
"length": {
"max": 255,
"ignore.empty.value": true,
"min": 3
},
"up-username-not-idn-homograph": {
"ignore.empty.value": true
}
},
"multivalued": false
},
{
"name": "email",
"displayName": "${email}",
"required": false,
"readOnly": false,
"validators": {
"multivalued": {
"max": "1"
},
"length": {
"max": 255,
"ignore.empty.value": true
},
"email": {
"ignore.empty.value": true
}
},
"multivalued": false
},
{
"name": "firstName",
"displayName": "${firstName}",
"required": false,
"readOnly": false,
"validators": {
"person-name-prohibited-characters": {
"ignore.empty.value": true
},
"multivalued": {
"max": "1"
},
"length": {
"max": 255,
"ignore.empty.value": true
}
},
"multivalued": false
},
{
"name": "lastName",
"displayName": "${lastName}",
"required": false,
"readOnly": false,
"validators": {
"person-name-prohibited-characters": {
"ignore.empty.value": true
},
"multivalued": {
"max": "1"
},
"length": {
"max": 255,
"ignore.empty.value": true
}
},
"multivalued": false
}
],
"groups": [
{
"name": "user-metadata",
"displayHeader": "User metadata",
"displayDescription": "Attributes, which refer to user metadata"
}
]
},
"enabled": true,
"createdTimestamp": 1764569865712,
"totp": false,
"disableableCredentialTypes": [],
"requiredActions": [],
"notBefore": 0,
"access": {
"manage": true
}
}
]Table 2-7 Supported Response Codes
| Code | Description |
|---|---|
| 200 OK | If the user exists, return a non-empty array with user
details.
If the user does not exist, returns an empty array. |
| 400 Bad Request | Bad Request |
| 401 Unauthorized | Missing Authentication |
| 403 Forbidden | Forbidden |
| 404 Not Found | Realm not found |
| 500 Internal Server Error | Internal Server Error |
2.5 Get individual user details by user ID
CNC Console uses Get individual user details by user ID REST API to get individual user details.
Type: GET
URI:
GET /{realm}/user/{id}Table 2-8 Request Path Parameter
| Field Name | Data Type | Mandatory(M)/Optional(O)/Conditional(C) | Description |
|---|---|---|---|
| id | string | M | Id of the user |
Sample URI:
http://${cncc-iam-ingress-extrenal-ip}:${cncc-iam-ingress-service-port}/cncc/auth/admin/realms/cncc/users/2a3113c0-48de-46d9-a563-6ce95eabbae4curl --location --request GET 'http://${cncc-iam-ingress-extrenal-ip}:${cncc-iam-ingress-service-port}/cncc/auth/admin/realms/cncc/users/754d6f6b-4ccb-44f1-abf1-00d717885dbe' \
--header 'Authorization: Bearer <token>'Example of the Response Body
The following is the example of the response body:
{
"id": "754d6f6b-4ccb-44f1-abf1-00d717885dbe",
"createdTimestamp": 1661232491550,
"username": "u1",
"email": "user@example.com",
"firstName": "CNCC",
"lastName": "User",
"enabled": true,
"totp": false,
"emailVerified": false,
"disableableCredentialTypes": [],
"requiredActions": [],
"notBefore": 0,
"access": {
"manageGroupMembership": true,
"resetPassword": true,
"view": true,
"mapRoles": true,
"impersonate": true,
"manage": true
}
}Table 2-9 Supported Response Codes
| Code | Description |
|---|---|
| 200 OK | OK |
| 401 Unauthorized | Missing Authentication |
| 403 Forbidden | Forbidden |
| 404 Not Found | Realm not found/User not found |
| 500 Internal Server Error | Internal Server Error |
2.6 Update Existing User
CNC Console uses Update existing user REST API to make
updates to an existing user.
Type: PUT
URI:
PUT /{realm}/users/{id}Table 2-10 Request Path Parameters
| Type | Name | Description | Data Type |
|---|---|---|---|
| Path | id | id of user | string |
| Body | username | (Optional) Updated username | string |
| Body | firstName | (Optional) Updated first name | string |
| Body | lastName | (Optional) Updated last name | string |
| Body | (Optional) Updated email | string | |
| Body | enabled | (Optional) Whether user is enabled | boolean |
| Body | emailVerified | (Optional) Whether email is verified | boolean |
| Body | attributes | (Optional) Custom user attributes | object |
http://${cncc-iam-ingress-extrenal-ip}:${cncc-iam-ingress-service-port}/cncc/auth/admin/realms/cncc/users/2a3113c0-48de-46d9-a563-6ce95eabbae4curl --location --request PUT 'http://${cncc-iam-ingress-extrenal-ip}:${cncc-iam-ingress-service-port}/cncc/auth/admin/realms/cncc/users/7a2d3608-95b2-4a88-8efb-dad48e7778e2' \
-d '{
"firstName": "CNCC",
"lastName": "user",
"email": "new@email.com",
"enabled": true,
"emailVerified": true
"attributes": {
"department": ["CNCC"]
}
}'
--header 'Authorization: Bearer <token>'{
"firstName": "CNCC",
"lastName": "user",
"email": "new@email.com",
"enabled": true,
"emailVerified": true,
"attributes": {
"department": "CNCC"
}
}Example of the Response Body
The following is the example of the response body:
204 No ContentTable 2-11 Supported Response Codes
| Code | Description |
|---|---|
| 204 No Content | No Content |
| 400 Bad Request | Invalid input data |
| 401 Unauthorized | Missing Authentication |
| 403 Forbidden | Forbidden |
| 404 Not Found | Realm or user not found |
| 409 Conflict | Email or username already exists |
| 500 Internal Server Error | Internal Server Error |
2.7 Delete the User
CNC Console uses Delete the User REST API to delete the user.
Type: DELETE
URI:
DELETE /{realm}/users/{id}
Table 2-12 Request Path Parameters
| Field Name | Data Type | Mandatory(M)/Optional(O)/Conditional(C) | Description |
|---|---|---|---|
| id | string | M | Id of the user |
Sample URI:
http://${cncc-iam-ingress-extrenal-ip}:${cncc-iam-ingress-service-port}/cncc/auth/admin/realms/cncc/users/2a3113c0-48de-46d9-a563-6ce95eabbae4
Example curl command:
curl --location --request DELETE 'http://${cncc-iam-ingress-extrenal-ip}:${cncc-iam-ingress-service-port}/cncc/auth/admin/realms/cncc/users/7a2d3608-95b2-4a88-8efb-dad48e7778e2' \--header 'Authorization: Bearer <token>'Example of the Response Code
The following is the example of the response code:
204 No ContentTable 2-13 Supported Response Codes
| Code | Description |
|---|---|
| 204 No Content | No Content |
| 401 Unauthorized | Missing Authentication |
| 403 Forbidden | Forbidden |
| 404 Not Found | Realm not found/User not found |
| 500 Internal Server Error | Internal Server Error |
2.8 Set up a New Password for the User or Reset the Temporary Password
CNC Console uses Setup a New Password for the Useror Reset the Temporary Password REST API to set up a new password for the user and Reset the temporary password.
Type: PUT
URI:
PUT /{realm}/users/{id}/reset-passwordTable 2-14 Request Parameters
| Type | Name | Description | Data type |
|---|---|---|---|
| Path | id | Id of user | string |
| Body | type | type | string |
| Body | value | value of new password | string |
Sample URI:
http://${cncc-iam-ingress-extrenal-ip}:${cncc-iam-ingress-service-port}/cncc/auth/admin/realms/cncc/users/2a3113c0-48de-46d9-a563-6ce95eabbae4/reset-password
Example curl command:
curl --location --request PUT 'http://${cncc-iam-ingress-extrenal-ip}:${cncc-iam-ingress-service-port}/cncc/auth/admin/realms/cncc/users/754d6f6b-4ccb-44f1-abf1-00d717885dbe/reset-password' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{ "type":"password","value":"<Password Values>","temporary":false}'
Example of the Request Body
The following is the example of the request body:
{
"type":"password",
"value":"<Password Value>"
}Example of the Response Code
The following is the example of the response code:
204 No ContentTable 2-15 Supported Response Codes
| Code | Description |
|---|---|
| 204 No Content | Set up a new password for the CNCC user {Requires payload}. |
| 400 Bad Request | Invalid Password |
| 401 Unauthorized | Missing Authentication |
| 403 Forbidden | Forbidden |
| 404 Not Found | Realm not found |
| 500 Internal Server Error | Internal Server Error |
2.9 Get Realm-level Role Mappings
CNC Console uses Get Realm-level Role Mappings REST API to get realm-level role mappings for a specific user id.
Type: GET
URI:
GET/{realm}/rolesSample URI:
http://${cncc-iam-ingress-extrenal-ip}:${cncc-iam-ingress-service-port}/cncc/auth/admin/realms/cncc/roles
Example curl command:
curl --location --request GET 'http://${cncc-iam-ingress-extrenal-ip}:${cncc-iam-ingress-service-port}/cncc/auth/admin/realms/cncc/roles' \
--header 'Authorization: Bearer <token>'Example of the Response Body
The following example shows the contents of the response body in JSON format:
[
{
"id": "fc5006e0-3927-4034-a01f-af70d779f1f8",
"name": "ADMIN",
"description": "Has access to all NF resources and can perform CRUD operations",
"composite": true,
"clientRole": false,
"containerId": "cncc"
},
{
"id": "1acd6c4a-115a-44ae-bf5f-139577f9df0a",
"name": "POLICY_WRITE",
"description": "Has access to only POLICY resources and can perform CRUD operation on Managed Objects of POLICY.",
"composite": true,
"clientRole": false,
"containerId": "cncc"
},
...]Table 2-16 Supported Response Codes
| Code | Description |
|---|---|
| 200 OK | OK |
| 401 Unauthorized | Missing Authentication |
| 403 Forbidden | Forbidden |
| 404 Not Found | Realm not found |
| 500 Internal Server Error | Internal Server Error |
2.10 Add Realm-level Role Mappings to the User
CNC Console uses Add Realm-level Role Mappings to the
User REST API to add realm-level role mappings to the
user.
Type:POST
URI:
POST/{realm}/users/{id}/rolemappings/realm
Table 2-17 Request Path Parameter
| Field Name | Data Type | Mandatory(M)/Optional(O)/Conditional(C) | Description |
|---|---|---|---|
| id | string | M | Id of the user. |
Sample URI:
http://${cncc-iam-ingress-extrenal-ip}:${cncc-iam-ingress-service-port}/cncc/auth/admin/realms/cncc/users/754d6f6b-4ccb-44f1-abf1-00d717885dbe/role-mappings/realm
Example curl command:
curl --location --request POST 'http://${cncc-iam-ingress-extrenal-ip}:${cncc-iam-ingress-service-port}/cncc/auth/admin/realms/cncc/users/754d6f6b-4ccb-44f1-abf1-00d717885dbe/role-mappings/realm' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '[
{
"id": "c47ba6c5-4cc8-4b59-96bd-2ef7e57121bd",
"name": "BSF_READ",
"description": "Has access to only BSF resources and can only perform READ Managed Objects of BSF.",
"composite": true,
"clientRole": false,
"containerId": "cncc"
}
]'Example of the Request Body
The following is the example of the request body:
[
{
"id": "c47ba6c5-4cc8-4b59-96bd-2ef7e57121bd",
"name": "BSF_READ",
"description": "Has access to only BSF resources and can only perform READ Managed Objects of BSF.",
"composite": true,
"clientRole": false,
"containerId": "cncc"
}
]Example of the Response Code
The following is the example of the response code:
204 No ContentTable 2-18 Supported Response Codes
| Code | Description |
|---|---|
| 204 No Content | No Content |
| 400 Bad Request | Bad Request |
| 401 Unauthorized | Missing Authentication |
| 403 Forbidden | Forbidden |
| 404 Not Found | Realm not found |
| 404 Not Found | User not found |
| 404 Not Found | Role not found |
| 500 Internal Server Error | Internal Server Error |
2.11 Get Realm-level Role Mappings for a specific user id
CNC Console uses Get Realm-level Role Mappings for a specific
user REST API to add realm-level role mappings to the user.
Type:GET
URI:
GET/{realm}/users/{id}/role-mappings/realmTable 2-19 Request Path Parameters
| Field Name | Data Type | Mandatory(M)/Optional(O)/Conditional(C) | Description |
|---|---|---|---|
| id | string | M | ID assigned to the user |
Sample URI:
http://${cncc-iam-ingress-extrenal-ip}:${cncc-iam-ingress-service-port}/cncc/auth/admin/realms/cncc/users/754d6f6b-4ccb-44f1-abf1-00d717885dbe/role-mappings/realm
Example curl command:
curl --location --request GET 'http://${cncc-iam-ingress-extrenal-ip}:${cncc-iam-ingress-service-port}/cncc/auth/admin/realms/cncc/users/754d6f6b-4ccb-44f1-abf1-00d717885dbe/role-mappings/realm' \
--header 'Authorization: Bearer <token>' Example of the Request Body
The following is the example of the request body:
[
{
"id": "fc5006e0-3927-4034-a01f-af70d779f1f8",
"name": "ADMIN",
"description": "Has access to all NF resources and can perform CRUD operations",
"composite": true,
"clientRole": false,
"containerId": "cncc"
},
{
"id": "503c9b40-b15e-4f88-891f-e71a495dd87f",
"name": "Cluster1",
"description": "Grants role to cluster1",
"composite": false,
"clientRole": false,
"containerId": "cncc"
},...
]Table 2-20 Supported Response Codes
| Code | Description |
|---|---|
| 200 OK | OK |
| 401 Unauthorized | Missing Authentication |
| 403 Forbidden | Forbidden |
| 404 Not Found | Realm not found |
| 404 Not Found | User not found |
| 500 Internal Server Error | Internal Server Error |
2.12 Remove All User Sessions Associated with the User
CNC Console uses Remove All User Sessions Associated with
the User REST API to remove all user sessions associated
with the user.
Type:POST
URI:
POST /{realm}/users/{id}/logoutTable 2-21 Request Path Parameter
| Field Name | Data Type | Mandatory(M)/Optional(O)/Conditional(C) | Description |
|---|---|---|---|
| id | string | M | Id of the user |
Sample URI:
http://${cncc-iam-ingress-extrenal-ip}:${cncc-iam-ingress-service-port}/cncc/auth/admin/realms/cncc/users/48cf183c-d3e4-4917-b3e5-5e01109f534c/logout
curl --location --request POST '${cncc-iam-ingress-extrenal-ip}:${cncc-iam-ingress-service-port}/cncc/auth/admin/realms/cncc/users/48cf183c-d3e4-4917-b3e5-5e01109f534c/logout' \
--header 'Authorization: Bearer <token>' Example of the Response Code
The following is the example of the response code:
204 No Content
Table 2-22 Supported Response Codes
| Code | Description |
|---|---|
| 204 No Content | No Content |
| 401 Unauthorized | Missing Authentication |
| 403 Forbidden | Forbidden |
| 404 Not Found | Realm not found |
| 404 Not Found | User not found |
| 500 Internal Server Error | Internal Server Error |
2.13 Get the Client details
CNC Console uses Get the Client details REST API to get
clients belonging to the realm.
Type: GET
URI:
GET/{realm}/clients
Sample URI:
http://${cncc-iam-ingress-extrenal-ip}:${cncc-iam-ingress-service-port}/cncc/auth/admin/realms/cncc/clients
Example curl command:
curl --location --request GET '${cncc-iam-ingress-extrenal-ip}:${cncc-iam-ingress-service-port}/cncc/auth/admin/realms/cncc/clients' \--header 'Authorization: Bearer <token>'Example of the Response Body
[
{
"id": "b7fa17bd-135f-441b-a5f2-1ea4897e04fc",
"clientId": "account",
"name": "${client_account}",
"rootUrl": "${authBaseUrl}",
"baseUrl": "/realms/cncc/account/",
"surrogateAuthRequired": false,
"enabled": true,
"alwaysDisplayInConsole": false,
"clientAuthenticatorType": "client-secret",
"secret": "**********",
"redirectUris": [
"/realms/cncc/account/*"
],
"webOrigins": [],
"notBefore": 0,
"bearerOnly": false,
"consentRequired": false,
"standardFlowEnabled": true,
"implicitFlowEnabled": false,
"directAccessGrantsEnabled": false,
"serviceAccountsEnabled": false,
"publicClient": false,
"frontchannelLogout": false,
"protocol": "openid-connect",
"attributes": {
"realm_client": "false",
"post.logout.redirect.uris": "+"
},
},
...]Table 2-23 Supported Response Codes
| Code | Description |
|---|---|
| 200 OK | OK |
| 401 Unauthorized | Missing Authentication |
| 403 Forbidden | Forbidden |
| 404 Not Found | Realm not found |
| 500 Internal Server Error | Internal Server Error |
2.14 Update the Client
CNC Console uses Update the Client REST API to update the
client. This API can be used to update the redirect URI.
Type: PUT
URI:
PUT/{realm}/clients/{id}Table 2-24 Request Body Parameters
| Field Name | Data Type | Mandatory(M)/Optional(O)/Conditional(C) | Description |
|---|---|---|---|
| clientId | string | M | Name of the client |
Table 2-25 Request Path Parameter
| Field Name | Data Type | Mandatory(M)/Optional(O)/Conditional(C) | Description |
|---|---|---|---|
| id | string | M | ID of the client |
Sample URI:
http://${cncc-iam-ingress-extrenal-ip}:${cncc-iam-ingress-service-port}/cncc/auth/admin/realms/cncc/clients/9faaa454-bbaf-4af0-91dd-2d01aa82776d
curl --location --request PUT 'http://${cncc-iam-ingress-extrenal-ip}:${cncc-iam-ingress-service-port}/cncc/auth/admin/realms/cncc/clients/9faaa454-bbaf-4af0-91dd-2d01aa82776d' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
"clientId": "cncc","rootUrl": "http://10.75.241.74:30006"
}'Example of the Request Body
The following is the example of the request body:
{
"clientId": "cncc",
"rootUrl": "http://10.75.241.74:30006"
}Example of the Response Code
The following is the example of the response code:
204 No Content
Table 2-26 Supported Response Codes
| Code | Description |
|---|---|
| 204 No Content | No Content |
| 400 Bad Request | Bad Request |
| 401 Unauthorized | Missing Authentication |
| 403 Forbidden | Forbidden |
| 404 Not Found | Realm not found |
| 404 Not Found | User not found |
| 409 Conflict | Conflict - Client already exists |
| 500 Internal Server Error | Internal Server Error |
2.15 List all the components configured in the realm
CNC Console uses List all the components configured in the realm REST API to get all the components belonging to the realm.
Type: GET
URI:
GET/{realm}/components
Sample URI:
http://${cncc-iam-ingress-extrenal-ip}:${cncc-iam-ingress-service-port}/cncc/auth/admin/realms/cncc/componentsExample curl command:
curl --location --request GET '${cncc-iam-ingress-extrenal-ip}:${cncc-iam-ingress-service-port}/cncc/auth/admin/realms/cncc/components' \--header 'Authorization: Bearer <token>'Example of the Response Body
The following example shows the contents of the response body in JSON format:
[
{
"id": "52cdaa68-16ee-4281-aadf-35d2ad3ad336",
"name": "creation date",
"providerId": "user-attribute-ldap-mapper",
"providerType": "org.keycloak.storage.ldap.mappers.LDAPStorageMapper",
"parentId": "pMHsaAcKS52Pws2WLfVDHA",
"config": {
"ldap.attribute": [
"whenCreated"
],
"is.mandatory.in.ldap": [
"false"
],
"read.only": [
"true"
],
"always.read.value.from.ldap": [
"true"
],
"user.model.attribute": [
"createTimestamp"
]
}
},
{
"id": "f8c30914-bb76-4074-ace8-2e6ddc86dec6",
"name": "email",
"providerId": "user-attribute-ldap-mapper",
"providerType": "org.keycloak.storage.ldap.mappers.LDAPStorageMapper",
"parentId": "pMHsaAcKS52Pws2WLfVDHA",
"config": {
"ldap.attribute": [
"mail"
],
"is.mandatory.in.ldap": [
"false"
],
"always.read.value.from.ldap": [
"false"
],
"read.only": [
"true"
],
"user.model.attribute": [
"email"
]
}
},
{
"id": "a73810f0-47f2-40a8-8638-1265592e0d46",
"name": "Max Clients Limit",
"providerId": "max-clients",
"providerType": "org.keycloak.services.clientregistration.policy.ClientRegistrationPolicy",
"parentId": "master",
"subType": "anonymous",
"config": {
"max-clients": [
"200"
]
}
},
{
"id": "4812404f-0754-4f3f-b517-c3df318bd957",
"name": "MSAD account controls",
"providerId": "msad-user-account-control-mapper",
"providerType": "org.keycloak.storage.ldap.mappers.LDAPStorageMapper",
"parentId": "pMHsaAcKS52Pws2WLfVDHA",
"config": {
"always.read.enabled.value.from.ldap": [
"true"
]
}
},
{
"id": "5fece912-f58c-4fe4-a1bf-56890d4a94b0",
"name": "hmac-generated",
"providerId": "hmac-generated",
"providerType": "org.keycloak.keys.KeyProvider",
"parentId": "master",
"config": {
"priority": [
"100"
],
"algorithm": [
"HS256"
]
}
},
{
"id": "89d2a381-94ac-4bc1-b5c6-7e3c3730ca64",
"name": "rsa-generated",
"providerId": "rsa-generated",
"providerType": "org.keycloak.keys.KeyProvider",
"parentId": "master",
"config": {
"priority": [
"100"
]
}
},
{
"id": "9a861e1d-0aee-414b-8612-97d688b1b408",
"name": "Trusted Hosts",
"providerId": "trusted-hosts",
"providerType": "org.keycloak.services.clientregistration.policy.ClientRegistrationPolicy",
"parentId": "master",
"subType": "anonymous",
"config": {
"host-sending-registration-request-must-match": [
"true"
],
"client-uris-must-match": [
"true"
]
}
},
{
"id": "710b78dc-a273-4691-a317-337eeb88641e",
"name": "modify date",
"providerId": "user-attribute-ldap-mapper",
"providerType": "org.keycloak.storage.ldap.mappers.LDAPStorageMapper",
"parentId": "pMHsaAcKS52Pws2WLfVDHA",
"config": {
"ldap.attribute": [
"whenChanged"
],
"is.mandatory.in.ldap": [
"false"
],
"always.read.value.from.ldap": [
"true"
],
"read.only": [
"true"
],
"user.model.attribute": [
"modifyTimestamp"
]
}
},
{
"id": "da8e26a0-7c34-4542-97cb-cc8bf393d894",
"name": "last name",
"providerId": "user-attribute-ldap-mapper",
"providerType": "org.keycloak.storage.ldap.mappers.LDAPStorageMapper",
"parentId": "pMHsaAcKS52Pws2WLfVDHA",
"config": {
"ldap.attribute": [
"sn"
],
"is.mandatory.in.ldap": [
"true"
],
"always.read.value.from.ldap": [
"true"
],
"read.only": [
"true"
],
"user.model.attribute": [
"lastName"
]
}
},
{
"id": "ae151b94-04b5-4f08-84e1-f7c10f05b7ac",
"name": "username",
"providerId": "user-attribute-ldap-mapper",
"providerType": "org.keycloak.storage.ldap.mappers.LDAPStorageMapper",
"parentId": "pMHsaAcKS52Pws2WLfVDHA",
"config": {
"ldap.attribute": [
"uid"
],
"is.mandatory.in.ldap": [
"true"
],
"read.only": [
"true"
],
"always.read.value.from.ldap": [
"false"
],
"user.model.attribute": [
"username"
]
}
},
{
"id": "22af0b0e-14d6-4b99-a598-20e55c98aedc",
"name": "aes-generated",
"providerId": "aes-generated",
"providerType": "org.keycloak.keys.KeyProvider",
"parentId": "master",
"config": {
"priority": [
"100"
]
}
},
{
"id": "73c75959-498c-4b9e-a75c-e5b4d71e3cd0",
"name": "Consent Required",
"providerId": "consent-required",
"providerType": "org.keycloak.services.clientregistration.policy.ClientRegistrationPolicy",
"parentId": "master",
"subType": "anonymous",
"config": {}
},
{
"id": "25b09a1b-5aee-4159-9223-ff9b38d6a0b1",
"name": "Allowed Client Scopes",
"providerId": "allowed-client-templates",
"providerType": "org.keycloak.services.clientregistration.policy.ClientRegistrationPolicy",
"parentId": "master",
"subType": "authenticated",
"config": {
"allow-default-scopes": [
"true"
]
}
},
{
"id": "900a1579-3b5c-42d8-b3e8-68d33a2765d2",
"name": "hmac-generated-hs512",
"providerId": "hmac-generated",
"providerType": "org.keycloak.keys.KeyProvider",
"parentId": "master",
"config": {
"priority": [
"100"
],
"algorithm": [
"HS512"
]
}
},
{
"id": "8372a450-59b0-4641-9aee-336d27983aab",
"providerId": "declarative-user-profile",
"providerType": "org.keycloak.userprofile.UserProfileProvider",
"parentId": "master",
"config": {
"kc.user.profile.config": [
"{\"attributes\":[{\"name\":\"username\",\"displayName\":\"${username}\",\"validations\":{\"length\":{\"min\":3,\"max\":255},\"username-prohibited-characters\":{},\"up-username-not-idn-homograph\":{}},\"permissions\":{\"view\":[\"admin\",\"user\"],\"edit\":[\"admin\",\"user\"]},\"multivalued\":false},{\"name\":\"email\",\"displayName\":\"${email}\",\"validations\":{\"email\":{},\"length\":{\"max\":255}},\"required\":{\"roles\":[\"user\"]},\"permissions\":{\"view\":[\"admin\",\"user\"],\"edit\":[\"admin\",\"user\"]},\"multivalued\":false},{\"name\":\"firstName\",\"displayName\":\"${firstName}\",\"validations\":{\"length\":{\"max\":255},\"person-name-prohibited-characters\":{}},\"required\":{\"roles\":[\"user\"]},\"permissions\":{\"view\":[\"admin\",\"user\"],\"edit\":[\"admin\",\"user\"]},\"multivalued\":false},{\"name\":\"lastName\",\"displayName\":\"${lastName}\",\"validations\":{\"length\":{\"max\":255},\"person-name-prohibited-characters\":{}},\"required\":{\"roles\":[\"user\"]},\"permissions\":{\"view\":[\"admin\",\"user\"],\"edit\":[\"admin\",\"user\"]},\"multivalued\":false}],\"groups\":[{\"name\":\"user-metadata\",\"displayHeader\":\"User metadata\",\"displayDescription\":\"Attributes, which refer to user metadata\"}],\"unmanagedAttributePolicy\":\"ENABLED\"}"
]
}
},
{
"id": "db72e90f-33d6-409f-ba92-591ea065b44a",
"name": "Allowed Protocol Mapper Types",
"providerId": "allowed-protocol-mappers",
"providerType": "org.keycloak.services.clientregistration.policy.ClientRegistrationPolicy",
"parentId": "master",
"subType": "authenticated",
"config": {
"allowed-protocol-mapper-types": [
"oidc-usermodel-attribute-mapper",
"saml-role-list-mapper",
"oidc-full-name-mapper",
"oidc-sha256-pairwise-sub-mapper",
"oidc-usermodel-property-mapper",
"oidc-address-mapper",
"saml-user-property-mapper",
"saml-user-attribute-mapper"
]
}
},
{
"id": "d249f14b-e6ed-41e1-9fc2-e526eb0b9424",
"name": "Kerberos principal attribute mapper",
"providerId": "kerberos-principal-attribute-mapper",
"providerType": "org.keycloak.storage.ldap.mappers.LDAPStorageMapper",
"parentId": "pMHsaAcKS52Pws2WLfVDHA",
"config": {}
},
{
"id": "3f13cbd3-e3bd-4ff8-80d3-74045af377e0",
"name": "first name",
"providerId": "user-attribute-ldap-mapper",
"providerType": "org.keycloak.storage.ldap.mappers.LDAPStorageMapper",
"parentId": "pMHsaAcKS52Pws2WLfVDHA",
"config": {
"ldap.attribute": [
"cn"
],
"is.mandatory.in.ldap": [
"true"
],
"always.read.value.from.ldap": [
"true"
],
"read.only": [
"true"
],
"user.model.attribute": [
"firstName"
]
}
},
{
"id": "4796c78e-87dc-4329-9c30-7cfcfc9291ef",
"name": "Allowed Client Scopes",
"providerId": "allowed-client-templates",
"providerType": "org.keycloak.services.clientregistration.policy.ClientRegistrationPolicy",
"parentId": "master",
"subType": "anonymous",
"config": {
"allow-default-scopes": [
"true"
]
}
},
{
"id": "1b44bc21-b71d-492a-bb02-842ce4d40d6a",
"name": "Full Scope Disabled",
"providerId": "scope",
"providerType": "org.keycloak.services.clientregistration.policy.ClientRegistrationPolicy",
"parentId": "master",
"subType": "anonymous",
"config": {}
},
{
"id": "ba4e8c45-16a7-44ef-aaf1-99cc2284f0d0",
"name": "Allowed Protocol Mapper Types",
"providerId": "allowed-protocol-mappers",
"providerType": "org.keycloak.services.clientregistration.policy.ClientRegistrationPolicy",
"parentId": "master",
"subType": "anonymous",
"config": {
"allowed-protocol-mapper-types": [
"oidc-full-name-mapper",
"oidc-usermodel-property-mapper",
"oidc-sha256-pairwise-sub-mapper",
"saml-user-attribute-mapper",
"oidc-address-mapper",
"saml-user-property-mapper",
"oidc-usermodel-attribute-mapper",
"saml-role-list-mapper"
]
}
},
{
"id": "pMHsaAcKS52Pws2WLfVDHA",
"name": "ldap",
"providerId": "ldap",
"providerType": "org.keycloak.storage.UserStorageProvider",
"parentId": "master",
"config": {
"fullSyncPeriod": [
"-1"
],
"pagination": [
"true"
],
"connectionTrace": [
"false"
],
"startTls": [
"false"
],
"connectionPooling": [
"false"
],
"usersDn": [
"ou=people,dc=oracle,dc=org"
],
"cachePolicy": [
"NO_CACHE"
],
"useKerberosForPasswordAuthentication": [
"false"
],
"importEnabled": [
"true"
],
"enabled": [
"true"
],
"changedSyncPeriod": [
"-1"
],
"bindCredential": [
"**********"
],
"usernameLDAPAttribute": [
"uid"
],
"bindDn": [
"cn=admin,dc=oracle,dc=org"
],
"vendor": [
"edirectory"
],
"uuidLDAPAttribute": [
"entryUUID"
],
"connectionUrl": [
"ldap://ldap1-openldap.ldap.svc.cluster.local:389"
],
"allowKerberosAuthentication": [
"false"
],
"syncRegistrations": [
"true"
],
"authType": [
"simple"
],
"krbPrincipalAttribute": [
"krb5PrincipalName"
],
"searchScope": [
"1"
],
"useTruststoreSpi": [
"always"
],
"usePasswordModifyExtendedOp": [
"false"
],
"trustEmail": [
"false"
],
"userObjectClasses": [
"inetOrgPerson, organizationalPerson, person, top"
],
"removeInvalidUsersEnabled": [
"true"
],
"rdnLDAPAttribute": [
"uid"
],
"editMode": [
"READ_ONLY"
],
"validatePasswordPolicy": [
"false"
]
}
}
]Table 2-27 Supported Response Codes
| Code | Description |
|---|---|
| 200 OK | Get all the components configured in the realm. |
| 401 Unauthorized | Missing Authentication |
| 403 Forbidden | Forbidden |
| 404 Not Found | Realm not found |
| 500 Internal Server Error | Internal Server Error |
2.16 Retrieve a single specific component by ID
CNC Console uses Retrieve a single specific component by ID REST API to retrieve a single specific component by ID.
Type: GET
URI:
/{realm}/components/{id}Table 2-28 Request Body Parameters
| Type | Field Name | Data Type | Mandatory(M)/Optional(O)/Conditional(C) | Description |
|---|---|---|---|---|
| Path | id | string | M | Id of the component. |
Sample URI:
http://${cncc-iam-ingress-extrenal-ip}:${cncc-iam-ingress-service-port}/cncc/auth/admin/realms/cncc/components/{id}curl --location --request GET '${cncc-iam-ingress-extrenal-ip}:${cncc-iam-ingress-service-port}/cncc/auth/admin/realms/cncc/components/pMHsaAcKS52Pws2WLfVDHA' \--header 'Authorization: Bearer <token>'Example of the Response Body
The following example shows the contents of the response body in JSON format:
{
"id": "pMHsaAcKS52Pws2WLfVDHA",
"name": "ldap",
"providerId": "ldap",
"providerType": "org.keycloak.storage.UserStorageProvider",
"parentId": "master",
"config": {
"fullSyncPeriod": [
"-1"
],
"pagination": [
"true"
],
"connectionTrace": [
"false"
],
"startTls": [
"false"
],
"connectionPooling": [
"false"
],
"usersDn": [
"ou=people,dc=oracle,dc=org"
],
"cachePolicy": [
"NO_CACHE"
],
"useKerberosForPasswordAuthentication": [
"false"
],
"importEnabled": [
"true"
],
"enabled": [
"true"
],
"changedSyncPeriod": [
"-1"
],
"bindCredential": [
"**********"
],
"usernameLDAPAttribute": [
"uid"
],
"bindDn": [
"cn=admin,dc=oracle,dc=org"
],
"vendor": [
"edirectory"
],
"uuidLDAPAttribute": [
"entryUUID"
],
"connectionUrl": [
"ldap://ldap1-openldap.ldap.svc.cluster.local:389"
],
"allowKerberosAuthentication": [
"false"
],
"syncRegistrations": [
"true"
],
"authType": [
"simple"
],
"krbPrincipalAttribute": [
"krb5PrincipalName"
],
"searchScope": [
"1"
],
"useTruststoreSpi": [
"always"
],
"usePasswordModifyExtendedOp": [
"false"
],
"trustEmail": [
"false"
],
"userObjectClasses": [
"inetOrgPerson, organizationalPerson, person, top"
],
"removeInvalidUsersEnabled": [
"true"
],
"rdnLDAPAttribute": [
"uid"
],
"editMode": [
"READ_ONLY"
],
"validatePasswordPolicy": [
"false"
]
}
}Table 2-29 Supported Response Codes
| Code | Description |
|---|---|
| 200 OK | Get a specific component by ID |
| 401 Unauthorized | Missing Authentication |
| 403 Forbidden | Forbidden |
| 404 Not Found | Realm not found/Component not found |
| 500 Internal Server Error | Internal Server Error |
2.17 Update the component
CNC Console uses Update the component REST API to update the component.
Type: PUT
URI:
/{realm}/components/{id}Table 2-30 Request Body Parameters
| Type | Field Name | Data Type | Mandatory(M)/Optional(O)/Conditional(C) | Description |
|---|---|---|---|---|
| Path | id | string | M | Id of the component. |
| Body | id | string | M | id of the LDAP component |
| Body | name | string | M | name of the component |
| Body | providerId | string | M | provider type identifier |
| Body | providerType | string | M | provider class |
| Body | parentId | string | M | realm to which component belongs |
| Body | config | object | M | configuration object |
| Body | bindCredential | string | M | LDAP bind password |
Sample URI:
http://${cncc-iam-ingress-extrenal-ip}:${cncc-iam-ingress-service-port}/cncc/auth/admin/realms/cncc/components/{id}curl --location --request PUT \
"http://10.75.213.68:30085/cncc/auth/admin/realms/master/components/pMHsaAcKS52Pws2WLfVDHA" \
--header "Authorization: Bearer $TOKEN" \
--header "Content-Type: application/json" \
--data-binary '{
"id":"pMHsaAcKS52Pws2WLfVDHA",
"name":"ldap",
"providerId":"ldap",
"providerType":"org.keycloak.storage.UserStorageProvider",
"parentId":"master",
"config":{
"pagination":["true"],
"fullSyncPeriod":["-1"],
"connectionTrace":["false"],
"startTls":["false"],
"connectionPooling":["false"],
"usersDn":["ou=people,dc=oracle,dc=org"],
"cachePolicy":["NO_CACHE"],
"useKerberosForPasswordAuthentication":["false"],
"importEnabled":["true"],
"enabled":["true"],
"bindCredential":["admin"],
"usernameLDAPAttribute":["uid"],
"bindDn":["cn=admin,dc=oracle,dc=org"],
"changedSyncPeriod":["-1"],
"vendor":["edirectory"],
"uuidLDAPAttribute":["entryUUID"],
"connectionUrl":["ldap://ldap1-openldap.ldap.svc.cluster.local:389"],
"allowKerberosAuthentication":["false"],
"syncRegistrations":["true"],
"authType":["simple"],
"krbPrincipalAttribute":["krb5PrincipalName"],
"searchScope":["1"],
"useTruststoreSpi":["always"],
"usePasswordModifyExtendedOp":["false"],
"trustEmail":["false"],
"userObjectClasses":["inetOrgPerson, organizationalPerson, person, top"],
"removeInvalidUsersEnabled":["true"],
"rdnLDAPAttribute":["uid"],
"editMode":["READ_ONLY"],
"validatePasswordPolicy":["false"]
}
}'Example of the Response Body
The following example shows the contents of the response body in JSON format:
Table 2-31 Supported Response Codes
| Code | Description |
|---|---|
| 204 OK | Updated the component |
| 400 Bad Request | Bad Request |
| 401 Unauthorized | Missing Authentication |
| 403 Forbidden | Forbidden |
| 404 Not Found | Realm not found/Component not found |
| 409 Conflict | Conflict - Component already exists |
| 500 Internal Server Error | Internal Server Error |