| I will run the following command:
|
| #TO SET GROUP SPI
|
| TOKEN=$(curl -s -X POST "http://localhost/auth/realms/master/protocol/openid-connect/token" \
|
| -d "client_id=admin-cli&username=admin&password=admin&grant_type=password" \
|
| | grep -o '"access_token":"[^"]*' | cut -d'"' -f4)
|
|
|
| curl -s -o /tmp/response.json -w "%{http_code}" -X POST "http://localhost/auth/admin/realms/info/components" \
|
| -H "Authorization: Bearer $TOKEN" \
|
| -H "Content-Type: application/json" \
|
| -d '{
|
| "name": "external-pumori-group-storage",
|
| "providerId": "external-pumori-group-storage",
|
| "providerType": "org.keycloak.storage.group.GroupStorageProvider",
|
| "parentId": "c8d748ad-4c22-41b1-ae11-09959be27429",
|
| "config": {
|
| "enabled": ["true"]
|
| }
|
| }'
|
|
|
| echo ""
|
| cat /tmp/response.json
|
|
|
| parent id is realm id not name
|
|
|
| #TO GET
|
| TOKEN=$(curl -s -X POST "http://localhost/auth/realms/master/protocol/openid-connect/token" \
|
| -d "client_id=admin-cli&username=admin&password=admin&grant_type=password" \
|
| | grep -o '"access_token":"[^"]*' | cut -d'"' -f4)
|
|
|
| curl -s -o /tmp/response.json -w "%{http_code}" -X curl -X GET "http://localhost/auth/admin/realms/info/components" \
|
| -H "Authorization: Bearer $TOKEN" \
|
| -H "Content-Type: application/json"
|
| echo ""
|
| cat /tmp/response.json
|
|
|
|
|
| FIND AND DELETE
|
| COMPONENT_ID=$(curl -s "http://localhost/auth/admin/realms/pumori/components" \
|
| -H "Authorization: Bearer $TOKEN" | \
|
| grep -B 3 "external-pumori-group-storage" | grep '"id"' | head -1 | cut -d'"' -f4)
|
|
|
| curl -X DELETE "http://localhost/auth/admin/realms/pumori/components/$COMPONENT_ID" \
|
| -H "Authorization: Bearer $TOKEN"
|