Get access token
curl \
-d "client_id=admin-cli" \
-d "username=admin" \
-d "password=admin" \
-d "grant_type=password" \
"http://localhost:8080/auth/realms/master/protocol/openid-connect/token"
Create realm json file
{
"id": "newrealm",
"realm": "newrealm",
"displayName": "New Realm",
"enabled": true,
"sslRequired": "external",
"registrationAllowed": false,
"loginWithEmailAllowed": true,
"duplicateEmailsAllowed": false,
"resetPasswordAllowed": false,
"editUsernameAllowed": false,
"bruteForceProtected": true
}
Create realm
curl -v POST \
-H "Authorization: Bearer <access-token>" \
-H "Content-Type: application/json" \
-d "@<realm-file>" \ http://localhost:8080/auth/admin/realms
Top comments (0)