From 85d84f68671903a3e601afa575fa8bc484abde42 Mon Sep 17 00:00:00 2001 From: forkimenjeckayang Date: Mon, 9 Sep 2024 14:27:46 +0100 Subject: [PATCH 01/11] Modified the .env file --- .env | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.env b/.env index 4d1b1ed..cb7a6dc 100644 --- a/.env +++ b/.env @@ -88,3 +88,13 @@ KC_DB_PASSWORD=postgres KC_START="start --hostname-strict=false --https-port=$KEYCLOAK_HTTPS_PORT --https-certificate-file=$KC_SERVER_CERT --https-certificate-key-file=$KC_SERVER_KEY" # For local env # KC_START=start-dev + +# Keycloak config CLI +REPO_URL="https://github.com/adorsys/keycloak-config-cli.git" +KC_CLI_DIR=$(pwd)/config +JAR_FILE=keycloak-config-cli.jar +KEYCLOAK_URL=https://kc-ssi.solutions.adorsys.com/ +KEYCLOAK_USER=$KEYCLOAK_ADMIN +KEYCLOAK_PASSWORD=$KEYCLOAK_ADMIN_PASSWORD +IMPORT_PATH=$KC_CLI_DIR/realm.json +PROJECT_DIR=$KC_CLI_DIR/keycloak-config-cli \ No newline at end of file From ba45f8c341fc09453a404d84cbe8a0452dc1a251 Mon Sep 17 00:00:00 2001 From: forkimenjeckayang Date: Mon, 9 Sep 2024 14:28:04 +0100 Subject: [PATCH 02/11] Modified the .gitignore file --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index b8365cf..01000b4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ signing_service-tmp.json target /.idea/ +config/keycloak-config-cli From 4ea478e708bf9bfff2e2579f95af00913a56caad Mon Sep 17 00:00:00 2001 From: forkimenjeckayang Date: Mon, 9 Sep 2024 14:28:47 +0100 Subject: [PATCH 03/11] Included script and configuration using keycloak-config-cli --- config/export_kc_config.sh | 37 + config/realm.json | 2730 ++++++++++++++++++++++++++++++++++++ 2 files changed, 2767 insertions(+) create mode 100755 config/export_kc_config.sh create mode 100644 config/realm.json diff --git a/config/export_kc_config.sh b/config/export_kc_config.sh new file mode 100755 index 0000000..6b19ac2 --- /dev/null +++ b/config/export_kc_config.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +# Variables +source .env + +# Check if the CLI project folder alredy exits, if so remove and clone again... +if [ -d "$PROJECT_DIR" ]; then + echo "Directory $PROJECT_DIR exists. Removing it..." + rm -rf "$PROJECT_DIR" || { echo "Failed to remove directory $PROJECT_DIR"; exit 1; } +else + echo "Directory does not exist" +fi + +# Clone the main branch of the Git repository +echo "Cloning repository from $REPO_URL..." +cd $KC_CLI_DIR && git clone --branch main "$REPO_URL" || { echo "Failed to clone repository"; exit 1; } + +# Navigate to cloned dir and build CLI tool +cd "$PROJECT_DIR" && mvn clean install -DskipTests || { echo "Failed to build the CLI tool"; exit 1; } + +# Check if JAR file is created in the target directory +if ls target/*.jar 1> /dev/null 2>&1; then + echo "Build successful! JAR file created." +else + echo "Build failed! No JAR file found." + exit 1 +fi + +# Run the JAR file with the specified parameters +echo "Running the JAR file..." +java -jar target/$JAR_FILE \ + --keycloak.url="$KEYCLOAK_URL" \ + --keycloak.user="$KEYCLOAK_USER" \ + --keycloak.password="$KEYCLOAK_PASSWORD" \ + --keycloak.ssl-verify="true" \ + --import.files.locations="$IMPORT_PATH" || { echo "Failed to run the JAR file"; exit 1; } +echo "Script completed successfully." diff --git a/config/realm.json b/config/realm.json new file mode 100644 index 0000000..d933951 --- /dev/null +++ b/config/realm.json @@ -0,0 +1,2730 @@ +{ + "id": "a9db380a-6f76-4054-904a-8eecab7db250", + "realm": "test1", + "displayName": "Keycloak", + "displayNameHtml": "
Keycloak
", + "notBefore": 0, + "defaultSignatureAlgorithm": "RS256", + "revokeRefreshToken": false, + "refreshTokenMaxReuse": 0, + "accessTokenLifespan": 60, + "accessTokenLifespanForImplicitFlow": 900, + "ssoSessionIdleTimeout": 1800, + "ssoSessionMaxLifespan": 36000, + "ssoSessionIdleTimeoutRememberMe": 0, + "ssoSessionMaxLifespanRememberMe": 0, + "offlineSessionIdleTimeout": 2592000, + "offlineSessionMaxLifespanEnabled": false, + "offlineSessionMaxLifespan": 5184000, + "clientSessionIdleTimeout": 0, + "clientSessionMaxLifespan": 0, + "clientOfflineSessionIdleTimeout": 0, + "clientOfflineSessionMaxLifespan": 0, + "accessCodeLifespan": 60, + "accessCodeLifespanUserAction": 300, + "accessCodeLifespanLogin": 1800, + "actionTokenGeneratedByAdminLifespan": 43200, + "actionTokenGeneratedByUserLifespan": 300, + "oauth2DeviceCodeLifespan": 600, + "oauth2DevicePollingInterval": 5, + "enabled": true, + "sslRequired": "external", + "registrationAllowed": false, + "registrationEmailAsUsername": false, + "rememberMe": false, + "verifyEmail": false, + "loginWithEmailAllowed": true, + "duplicateEmailsAllowed": false, + "resetPasswordAllowed": false, + "editUsernameAllowed": false, + "bruteForceProtected": false, + "permanentLockout": false, + "maxTemporaryLockouts": 0, + "maxFailureWaitSeconds": 900, + "minimumQuickLoginWaitSeconds": 60, + "waitIncrementSeconds": 60, + "quickLoginCheckMilliSeconds": 1000, + "maxDeltaTimeSeconds": 43200, + "failureFactor": 30, + "roles": { + "realm": [ + { + "id": "fe401775-dc48-411f-bee5-13cec60a2b71", + "name": "admin", + "description": "${role_admin}", + "composite": true, + "composites": { + "realm": [ + "create-realm" + ], + "client": { + "master-realm": [ + "manage-clients", + "view-identity-providers", + "manage-users", + "view-events", + "view-authorization", + "create-client", + "manage-authorization", + "manage-events", + "query-users", + "view-users", + "query-realms", + "manage-realm", + "view-clients", + "view-realm", + "manage-identity-providers", + "query-groups", + "query-clients", + "impersonation" + ] + } + }, + "clientRole": false, + "containerId": "a9db380a-6f76-4054-904a-8eecab7db250", + "attributes": {} + }, + { + "id": "007e5b55-f84c-441d-805d-e7a9d4370bcc", + "name": "uma_authorization", + "description": "${role_uma_authorization}", + "composite": false, + "clientRole": false, + "containerId": "a9db380a-6f76-4054-904a-8eecab7db250", + "attributes": {} + }, + { + "id": "927796a5-2326-460e-adf5-2f547bc4e795", + "name": "offline_access", + "description": "${role_offline-access}", + "composite": false, + "clientRole": false, + "containerId": "a9db380a-6f76-4054-904a-8eecab7db250", + "attributes": {} + }, + { + "id": "bacff458-0c44-4ab1-a6ce-a34346513dbb", + "name": "create-realm", + "description": "${role_create-realm}", + "composite": false, + "clientRole": false, + "containerId": "a9db380a-6f76-4054-904a-8eecab7db250", + "attributes": {} + }, + { + "id": "199fd022-a715-4790-9e84-574b0438e8ad", + "name": "default-roles-master", + "description": "${role_default-roles}", + "composite": true, + "composites": { + "realm": [ + "offline_access", + "uma_authorization" + ], + "client": { + "account": [ + "view-profile", + "manage-account" + ] + } + }, + "clientRole": false, + "containerId": "a9db380a-6f76-4054-904a-8eecab7db250", + "attributes": {} + } + ], + "client": { + "security-admin-console": [], + "admin-cli": [], + "account-console": [], + "broker": [ + { + "id": "afcc6b54-8947-4a95-954b-662bb17ad6aa", + "name": "read-token", + "description": "${role_read-token}", + "composite": false, + "clientRole": true, + "containerId": "496c39b1-ae8d-4668-9b53-8281e2ca583c", + "attributes": {} + } + ], + "master-realm": [ + { + "id": "931820f8-7637-40e4-b55e-896fbbb0b6a2", + "name": "manage-clients", + "description": "${role_manage-clients}", + "composite": false, + "clientRole": true, + "containerId": "74ee282f-c070-4e6c-b079-2ca41cf1e60a", + "attributes": {} + }, + { + "id": "959466b3-dd19-496d-bab1-6b64afc99f01", + "name": "view-identity-providers", + "description": "${role_view-identity-providers}", + "composite": false, + "clientRole": true, + "containerId": "74ee282f-c070-4e6c-b079-2ca41cf1e60a", + "attributes": {} + }, + { + "id": "d89e3a20-3c5d-4c73-aa76-e4336bc0d582", + "name": "manage-users", + "description": "${role_manage-users}", + "composite": false, + "clientRole": true, + "containerId": "74ee282f-c070-4e6c-b079-2ca41cf1e60a", + "attributes": {} + }, + { + "id": "f4537778-f835-48ba-aec1-cbfd0d5ddb61", + "name": "view-events", + "description": "${role_view-events}", + "composite": false, + "clientRole": true, + "containerId": "74ee282f-c070-4e6c-b079-2ca41cf1e60a", + "attributes": {} + }, + { + "id": "bf52f6aa-b7f7-4f20-ae41-ec3882db0403", + "name": "view-authorization", + "description": "${role_view-authorization}", + "composite": false, + "clientRole": true, + "containerId": "74ee282f-c070-4e6c-b079-2ca41cf1e60a", + "attributes": {} + }, + { + "id": "1e6978a7-e0de-49a7-8c8c-70b268f297b7", + "name": "create-client", + "description": "${role_create-client}", + "composite": false, + "clientRole": true, + "containerId": "74ee282f-c070-4e6c-b079-2ca41cf1e60a", + "attributes": {} + }, + { + "id": "f6cac6fa-ad92-438a-a463-91d1076d8d04", + "name": "manage-authorization", + "description": "${role_manage-authorization}", + "composite": false, + "clientRole": true, + "containerId": "74ee282f-c070-4e6c-b079-2ca41cf1e60a", + "attributes": {} + }, + { + "id": "c2e27adb-221f-4115-9c81-d00bc6641af8", + "name": "manage-events", + "description": "${role_manage-events}", + "composite": false, + "clientRole": true, + "containerId": "74ee282f-c070-4e6c-b079-2ca41cf1e60a", + "attributes": {} + }, + { + "id": "f5964cc9-05b3-423f-99cc-09005e10afda", + "name": "query-users", + "description": "${role_query-users}", + "composite": false, + "clientRole": true, + "containerId": "74ee282f-c070-4e6c-b079-2ca41cf1e60a", + "attributes": {} + }, + { + "id": "47c49360-5eee-4a4c-aaad-76e26a8cb9a7", + "name": "query-realms", + "description": "${role_query-realms}", + "composite": false, + "clientRole": true, + "containerId": "74ee282f-c070-4e6c-b079-2ca41cf1e60a", + "attributes": {} + }, + { + "id": "1eacf0b8-4784-4850-ad87-08185f8ebfb8", + "name": "view-users", + "description": "${role_view-users}", + "composite": true, + "composites": { + "client": { + "master-realm": [ + "query-users", + "query-groups" + ] + } + }, + "clientRole": true, + "containerId": "74ee282f-c070-4e6c-b079-2ca41cf1e60a", + "attributes": {} + }, + { + "id": "80d0caeb-a615-4ce6-bd1a-1ca0d92a76a9", + "name": "manage-realm", + "description": "${role_manage-realm}", + "composite": false, + "clientRole": true, + "containerId": "74ee282f-c070-4e6c-b079-2ca41cf1e60a", + "attributes": {} + }, + { + "id": "65258920-6324-42eb-9dd8-67df6f157567", + "name": "view-clients", + "description": "${role_view-clients}", + "composite": true, + "composites": { + "client": { + "master-realm": [ + "query-clients" + ] + } + }, + "clientRole": true, + "containerId": "74ee282f-c070-4e6c-b079-2ca41cf1e60a", + "attributes": {} + }, + { + "id": "d0b7ff7d-7586-4c1d-ac26-b58353cd096f", + "name": "view-realm", + "description": "${role_view-realm}", + "composite": false, + "clientRole": true, + "containerId": "74ee282f-c070-4e6c-b079-2ca41cf1e60a", + "attributes": {} + }, + { + "id": "eb36c4fc-51d4-49d1-ab7c-8723430b79c0", + "name": "manage-identity-providers", + "description": "${role_manage-identity-providers}", + "composite": false, + "clientRole": true, + "containerId": "74ee282f-c070-4e6c-b079-2ca41cf1e60a", + "attributes": {} + }, + { + "id": "c3a5b61a-5a10-487b-88c8-38011d6b49d8", + "name": "query-clients", + "description": "${role_query-clients}", + "composite": false, + "clientRole": true, + "containerId": "74ee282f-c070-4e6c-b079-2ca41cf1e60a", + "attributes": {} + }, + { + "id": "4f65b30d-ddeb-41a5-8d7f-52279e1fb92b", + "name": "query-groups", + "description": "${role_query-groups}", + "composite": false, + "clientRole": true, + "containerId": "74ee282f-c070-4e6c-b079-2ca41cf1e60a", + "attributes": {} + }, + { + "id": "38935eb6-7f4d-47fc-8565-27a249c6dc2a", + "name": "impersonation", + "description": "${role_impersonation}", + "composite": false, + "clientRole": true, + "containerId": "74ee282f-c070-4e6c-b079-2ca41cf1e60a", + "attributes": {} + } + ], + "account": [ + { + "id": "a4af12af-90c5-4d0e-a5d4-5b428c7493ab", + "name": "manage-consent", + "description": "${role_manage-consent}", + "composite": true, + "composites": { + "client": { + "account": [ + "view-consent" + ] + } + }, + "clientRole": true, + "containerId": "7f5c4b2c-8fb7-4571-8a95-ede4a7c93ef1", + "attributes": {} + }, + { + "id": "27482fd3-1f90-42eb-93db-1a47822f6e16", + "name": "view-consent", + "description": "${role_view-consent}", + "composite": false, + "clientRole": true, + "containerId": "7f5c4b2c-8fb7-4571-8a95-ede4a7c93ef1", + "attributes": {} + }, + { + "id": "6b488605-8504-4731-a006-f63cc5ea40ad", + "name": "delete-account", + "description": "${role_delete-account}", + "composite": false, + "clientRole": true, + "containerId": "7f5c4b2c-8fb7-4571-8a95-ede4a7c93ef1", + "attributes": {} + }, + { + "id": "7bdb6bc9-05bb-4ed4-b32d-fcdd9b2637e4", + "name": "manage-account-links", + "description": "${role_manage-account-links}", + "composite": false, + "clientRole": true, + "containerId": "7f5c4b2c-8fb7-4571-8a95-ede4a7c93ef1", + "attributes": {} + }, + { + "id": "ef060e3b-0aeb-4ceb-8fbb-24c46059de36", + "name": "view-groups", + "description": "${role_view-groups}", + "composite": false, + "clientRole": true, + "containerId": "7f5c4b2c-8fb7-4571-8a95-ede4a7c93ef1", + "attributes": {} + }, + { + "id": "09b18d21-36f1-40ca-a2bd-2636cc1a04f3", + "name": "view-profile", + "description": "${role_view-profile}", + "composite": false, + "clientRole": true, + "containerId": "7f5c4b2c-8fb7-4571-8a95-ede4a7c93ef1", + "attributes": {} + }, + { + "id": "0f78fa59-0479-4915-8532-e5b2a5819876", + "name": "view-applications", + "description": "${role_view-applications}", + "composite": false, + "clientRole": true, + "containerId": "7f5c4b2c-8fb7-4571-8a95-ede4a7c93ef1", + "attributes": {} + }, + { + "id": "91823415-58d3-43aa-aa7d-880b6453f1aa", + "name": "manage-account", + "description": "${role_manage-account}", + "composite": true, + "composites": { + "client": { + "account": [ + "manage-account-links" + ] + } + }, + "clientRole": true, + "containerId": "7f5c4b2c-8fb7-4571-8a95-ede4a7c93ef1", + "attributes": {} + } + ], + "oid4vci-client": [], + "openid4vc-rest-api": [] + } + }, + "groups": [], + "defaultRole": { + "id": "199fd022-a715-4790-9e84-574b0438e8ad", + "name": "default-roles-master", + "description": "${role_default-roles}", + "composite": true, + "clientRole": false, + "containerId": "a9db380a-6f76-4054-904a-8eecab7db250" + }, + "requiredCredentials": [ + "password" + ], + "otpPolicyType": "totp", + "otpPolicyAlgorithm": "HmacSHA1", + "otpPolicyInitialCounter": 0, + "otpPolicyDigits": 6, + "otpPolicyLookAheadWindow": 1, + "otpPolicyPeriod": 30, + "otpPolicyCodeReusable": false, + "otpSupportedApplications": [ + "totpAppFreeOTPName", + "totpAppGoogleName", + "totpAppMicrosoftAuthenticatorName" + ], + "localizationTexts": {}, + "webAuthnPolicyRpEntityName": "keycloak", + "webAuthnPolicySignatureAlgorithms": [ + "ES256", + "RS256" + ], + "webAuthnPolicyRpId": "", + "webAuthnPolicyAttestationConveyancePreference": "not specified", + "webAuthnPolicyAuthenticatorAttachment": "not specified", + "webAuthnPolicyRequireResidentKey": "not specified", + "webAuthnPolicyUserVerificationRequirement": "not specified", + "webAuthnPolicyCreateTimeout": 0, + "webAuthnPolicyAvoidSameAuthenticatorRegister": false, + "webAuthnPolicyAcceptableAaguids": [], + "webAuthnPolicyExtraOrigins": [], + "webAuthnPolicyPasswordlessRpEntityName": "keycloak", + "webAuthnPolicyPasswordlessSignatureAlgorithms": [ + "ES256", + "RS256" + ], + "webAuthnPolicyPasswordlessRpId": "", + "webAuthnPolicyPasswordlessAttestationConveyancePreference": "not specified", + "webAuthnPolicyPasswordlessAuthenticatorAttachment": "not specified", + "webAuthnPolicyPasswordlessRequireResidentKey": "not specified", + "webAuthnPolicyPasswordlessUserVerificationRequirement": "not specified", + "webAuthnPolicyPasswordlessCreateTimeout": 0, + "webAuthnPolicyPasswordlessAvoidSameAuthenticatorRegister": false, + "webAuthnPolicyPasswordlessAcceptableAaguids": [], + "webAuthnPolicyPasswordlessExtraOrigins": [], + "scopeMappings": [ + { + "clientScope": "offline_access", + "roles": [ + "offline_access" + ] + } + ], + "clientScopeMappings": { + "account": [ + { + "client": "account-console", + "roles": [ + "manage-account", + "view-groups" + ] + } + ] + }, + "clients": [ + { + "id": "7f5c4b2c-8fb7-4571-8a95-ede4a7c93ef1", + "clientId": "account", + "name": "${client_account}", + "rootUrl": "${authBaseUrl}", + "baseUrl": "/realms/master/account/", + "surrogateAuthRequired": false, + "enabled": true, + "alwaysDisplayInConsole": false, + "clientAuthenticatorType": "client-secret", + "redirectUris": [ + "/realms/master/account/*" + ], + "webOrigins": [], + "notBefore": 0, + "bearerOnly": false, + "consentRequired": false, + "standardFlowEnabled": true, + "implicitFlowEnabled": false, + "directAccessGrantsEnabled": false, + "serviceAccountsEnabled": false, + "publicClient": true, + "frontchannelLogout": false, + "protocol": "openid-connect", + "attributes": { + "realm_client": "false", + "post.logout.redirect.uris": "+" + }, + "authenticationFlowBindingOverrides": {}, + "fullScopeAllowed": false, + "nodeReRegistrationTimeout": 0, + "defaultClientScopes": [ + "web-origins", + "acr", + "roles", + "profile", + "basic", + "email" + ], + "optionalClientScopes": [ + "address", + "phone", + "offline_access", + "microprofile-jwt" + ] + }, + { + "id": "1951d8d8-f9dd-41c4-a9bb-c4c271949a90", + "clientId": "account-console", + "name": "${client_account-console}", + "rootUrl": "${authBaseUrl}", + "baseUrl": "/realms/master/account/", + "surrogateAuthRequired": false, + "enabled": true, + "alwaysDisplayInConsole": false, + "clientAuthenticatorType": "client-secret", + "redirectUris": [ + "/realms/master/account/*" + ], + "webOrigins": [], + "notBefore": 0, + "bearerOnly": false, + "consentRequired": false, + "standardFlowEnabled": true, + "implicitFlowEnabled": false, + "directAccessGrantsEnabled": false, + "serviceAccountsEnabled": false, + "publicClient": true, + "frontchannelLogout": false, + "protocol": "openid-connect", + "attributes": { + "realm_client": "false", + "post.logout.redirect.uris": "+", + "pkce.code.challenge.method": "S256" + }, + "authenticationFlowBindingOverrides": {}, + "fullScopeAllowed": false, + "nodeReRegistrationTimeout": 0, + "protocolMappers": [ + { + "id": "725bd921-e375-4f87-8c4d-47c188faef38", + "name": "audience resolve", + "protocol": "openid-connect", + "protocolMapper": "oidc-audience-resolve-mapper", + "consentRequired": false, + "config": {} + } + ], + "defaultClientScopes": [ + "web-origins", + "acr", + "roles", + "profile", + "basic", + "email" + ], + "optionalClientScopes": [ + "address", + "phone", + "offline_access", + "microprofile-jwt" + ] + }, + { + "id": "19bb1419-d973-426c-aff6-a83dbbe7c3e9", + "clientId": "admin-cli", + "name": "${client_admin-cli}", + "surrogateAuthRequired": false, + "enabled": true, + "alwaysDisplayInConsole": false, + "clientAuthenticatorType": "client-secret", + "redirectUris": [], + "webOrigins": [], + "notBefore": 0, + "bearerOnly": false, + "consentRequired": false, + "standardFlowEnabled": false, + "implicitFlowEnabled": false, + "directAccessGrantsEnabled": true, + "serviceAccountsEnabled": false, + "publicClient": true, + "frontchannelLogout": false, + "protocol": "openid-connect", + "attributes": { + "realm_client": "false" + }, + "authenticationFlowBindingOverrides": {}, + "fullScopeAllowed": false, + "nodeReRegistrationTimeout": 0, + "defaultClientScopes": [ + "web-origins", + "acr", + "roles", + "profile", + "basic", + "email" + ], + "optionalClientScopes": [ + "address", + "phone", + "offline_access", + "microprofile-jwt" + ] + }, + { + "id": "496c39b1-ae8d-4668-9b53-8281e2ca583c", + "clientId": "broker", + "name": "${client_broker}", + "surrogateAuthRequired": false, + "enabled": true, + "alwaysDisplayInConsole": false, + "clientAuthenticatorType": "client-secret", + "redirectUris": [], + "webOrigins": [], + "notBefore": 0, + "bearerOnly": true, + "consentRequired": false, + "standardFlowEnabled": true, + "implicitFlowEnabled": false, + "directAccessGrantsEnabled": false, + "serviceAccountsEnabled": false, + "publicClient": false, + "frontchannelLogout": false, + "protocol": "openid-connect", + "attributes": { + "realm_client": "true" + }, + "authenticationFlowBindingOverrides": {}, + "fullScopeAllowed": false, + "nodeReRegistrationTimeout": 0, + "defaultClientScopes": [ + "web-origins", + "acr", + "roles", + "profile", + "basic", + "email" + ], + "optionalClientScopes": [ + "address", + "phone", + "offline_access", + "microprofile-jwt" + ] + }, + { + "id": "74ee282f-c070-4e6c-b079-2ca41cf1e60a", + "clientId": "master-realm", + "name": "master Realm", + "surrogateAuthRequired": false, + "enabled": true, + "alwaysDisplayInConsole": false, + "clientAuthenticatorType": "client-secret", + "redirectUris": [], + "webOrigins": [], + "notBefore": 0, + "bearerOnly": true, + "consentRequired": false, + "standardFlowEnabled": true, + "implicitFlowEnabled": false, + "directAccessGrantsEnabled": false, + "serviceAccountsEnabled": false, + "publicClient": false, + "frontchannelLogout": false, + "attributes": { + "realm_client": "true" + }, + "authenticationFlowBindingOverrides": {}, + "fullScopeAllowed": false, + "nodeReRegistrationTimeout": 0, + "defaultClientScopes": [ + "web-origins", + "acr", + "roles", + "profile", + "basic", + "email" + ], + "optionalClientScopes": [ + "address", + "phone", + "offline_access", + "microprofile-jwt" + ] + }, + { + "id": "oid4vci-client", + "clientId": "oid4vci-client", + "name": "OID4VC-VCI Client", + "surrogateAuthRequired": false, + "enabled": true, + "alwaysDisplayInConsole": false, + "clientAuthenticatorType": "client-secret", + "redirectUris": [], + "webOrigins": [], + "notBefore": 0, + "bearerOnly": false, + "consentRequired": false, + "standardFlowEnabled": true, + "implicitFlowEnabled": false, + "directAccessGrantsEnabled": false, + "serviceAccountsEnabled": false, + "publicClient": true, + "frontchannelLogout": false, + "protocol": "oid4vc", + "attributes": { + "vc.test-credential.vct": "https://credentials.example.com/test-credential", + "vc.test-credential.credential_signing_alg_values_supported": "ES256,ES384", + "vc.test-credential.format": "vc+sd-jwt", + "vc.IdentityCredential.scope": "identity_credential", + "vc.IdentityCredential.credential_signing_alg_values_supported": "ES256,ES384", + "vc.IdentityCredential.vct": "https://credentials.example.com/identity_credential", + "vc.IdentityCredential.claims": "{\"given_name\":{\"display\":[{\"name\":\"الاسم الشخصي\",\"locale\":\"ar\"},{\"name\":\"Vorname\",\"locale\":\"de\"},{\"name\":\"Given Name\",\"locale\":\"en\"},{\"name\":\"Nombre\",\"locale\":\"es\"},{\"name\":\"نام\",\"locale\":\"fa\"},{\"name\":\"Etunimi\",\"locale\":\"fi\"},{\"name\":\"Prénom\",\"locale\":\"fr\"},{\"name\":\"पहचानी गई नाम\",\"locale\":\"hi\"},{\"name\":\"Nome\",\"locale\":\"it\"},{\"name\":\"名\",\"locale\":\"ja\"},{\"name\":\"Овог нэр\",\"locale\":\"mn\"},{\"name\":\"Voornaam\",\"locale\":\"nl\"},{\"name\":\"Nome Próprio\",\"locale\":\"pt\"},{\"name\":\"Förnamn\",\"locale\":\"sv\"},{\"name\":\"مسلمان نام\",\"locale\":\"ur\"}]},\"family_name\":{\"display\":[{\"name\":\"اسم العائلة\",\"locale\":\"ar\"},{\"name\":\"Nachname\",\"locale\":\"de\"},{\"name\":\"Family Name\",\"locale\":\"en\"},{\"name\":\"Apellido\",\"locale\":\"es\"},{\"name\":\"نام خانوادگی\",\"locale\":\"fa\"},{\"name\":\"Sukunimi\",\"locale\":\"fi\"},{\"name\":\"Nom de famille\",\"locale\":\"fr\"},{\"name\":\"परिवार का नाम\",\"locale\":\"hi\"},{\"name\":\"Cognome\",\"locale\":\"it\"},{\"name\":\"姓\",\"locale\":\"ja\"},{\"name\":\"өөрийн нэр\",\"locale\":\"mn\"},{\"name\":\"Achternaam\",\"locale\":\"nl\"},{\"name\":\"Sobrenome\",\"locale\":\"pt\"},{\"name\":\"Efternamn\",\"locale\":\"sv\"},{\"name\":\"خاندانی نام\",\"locale\":\"ur\"}]},\"birthdate\":{\"display\":[{\"name\":\"تاريخ الميلاد\",\"locale\":\"ar\"},{\"name\":\"Geburtsdatum\",\"locale\":\"de\"},{\"name\":\"Date of Birth\",\"locale\":\"en\"},{\"name\":\"Fecha de Nacimiento\",\"locale\":\"es\"},{\"name\":\"تاریخ تولد\",\"locale\":\"fa\"},{\"name\":\"Syntymäaika\",\"locale\":\"fi\"},{\"name\":\"Date de naissance\",\"locale\":\"fr\"},{\"name\":\"जन्म की तारीख\",\"locale\":\"hi\"},{\"name\":\"Data di nascita\",\"locale\":\"it\"},{\"name\":\"生年月日\",\"locale\":\"ja\"},{\"name\":\"төрсөн өдөр\",\"locale\":\"mn\"},{\"name\":\"Geboortedatum\",\"locale\":\"nl\"},{\"name\":\"Data de Nascimento\",\"locale\":\"pt\"},{\"name\":\"Födelsedatum\",\"locale\":\"sv\"},{\"name\":\"تاریخ پیدائش\",\"locale\":\"ur\"}]}}", + "realm_client": "false", + "vc.IdentityCredential.expiry_in_s": "31536000", + "vc.test-credential.claims": "{\"firstName\":{},\"lastName\":{},\"email\":{}}", + "vc.IdentityCredential.cryptographic_binding_methods_supported": "jwk", + "vc.test-credential.display.0": "{\"name\": \"Test Credential\"}", + "vc.IdentityCredential.proof_types_supported": "{\"jwt\":{\"proof_signing_alg_values_supported\":[\"ES256\"]}}", + "vc.test-credential.expiry_in_s": "100", + "vc.test-credential.scope": "test-credential", + "vc.IdentityCredential.display.0": "{\"name\": \"Identity Credential\"}", + "vc.IdentityCredential.format": "vc+sd-jwt" + }, + "authenticationFlowBindingOverrides": {}, + "fullScopeAllowed": true, + "nodeReRegistrationTimeout": -1, + "protocolMappers": [ + { + "id": "84af2545-7d88-4ed5-bf3f-76dde314850d", + "name": "nbf-oid4vc-issued-at-time-claim-mapper-test-credential", + "protocol": "oid4vc", + "protocolMapper": "oid4vc-issued-at-time-claim-mapper", + "consentRequired": false, + "config": { + "subjectProperty": "nbf", + "supportedCredentialTypes": "test-credential", + "valueSource": "COMPUTE" + } + }, + { + "id": "family_name-mapper-001", + "name": "family_name-mapper", + "protocol": "oid4vc", + "protocolMapper": "oid4vc-user-attribute-mapper", + "consentRequired": false, + "config": { + "subjectProperty": "family_name", + "supportedCredentialTypes": "identity_credential", + "userAttribute": "lastName" + } + }, + { + "id": "937e3b5d-6b75-4b09-abbd-d9a8cc578286", + "name": "iat-oid4vc-issued-at-time-claim-mapper-test-credential", + "protocol": "oid4vc", + "protocolMapper": "oid4vc-issued-at-time-claim-mapper", + "consentRequired": false, + "config": { + "truncateToTimeUnit": "HOURS", + "supportedCredentialTypes": "test-credential", + "valueSource": "COMPUTE" + } + }, + { + "id": "static-mapper-001", + "name": "static-mapper", + "protocol": "oid4vc", + "protocolMapper": "oid4vc-static-claim-mapper", + "consentRequired": false, + "config": { + "subjectProperty": "static", + "supportedCredentialTypes": "test-credential", + "subjectValue": "Value" + } + }, + { + "id": "93d8da0b-ea6d-415b-8c87-3f5c2a14b2b5", + "name": "iat-oid4vc-issued-at-time-claim-mapper-identity_credential", + "protocol": "oid4vc", + "protocolMapper": "oid4vc-issued-at-time-claim-mapper", + "consentRequired": false, + "config": { + "truncateToTimeUnit": "HOURS", + "supportedCredentialTypes": "identity_credential", + "valueSource": "COMPUTE" + } + }, + { + "id": "given_name-mapper-001", + "name": "given_name-mapper", + "protocol": "oid4vc", + "protocolMapper": "oid4vc-user-attribute-mapper", + "consentRequired": false, + "config": { + "subjectProperty": "given_name", + "supportedCredentialTypes": "identity_credential", + "userAttribute": "firstName" + } + }, + { + "id": "role-mapper-001", + "name": "role-mapper", + "protocol": "oid4vc", + "protocolMapper": "oid4vc-target-role-mapper", + "consentRequired": false, + "config": { + "subjectProperty": "roles", + "supportedCredentialTypes": "test-credential", + "clientId": "oid4vci-client" + } + }, + { + "id": "email-mapper-001", + "name": "email-mapper", + "protocol": "oid4vc", + "protocolMapper": "oid4vc-user-attribute-mapper", + "consentRequired": false, + "config": { + "subjectProperty": "email", + "supportedCredentialTypes": "test-credential", + "userAttribute": "email" + } + }, + { + "id": "id-mapper-001", + "name": "id-mapper", + "protocol": "oid4vc", + "protocolMapper": "oid4vc-subject-id-mapper", + "consentRequired": false, + "config": { + "supportedCredentialTypes": "test-credential" + } + }, + { + "id": "lastName-mapper-001", + "name": "lastName-mapper", + "protocol": "oid4vc", + "protocolMapper": "oid4vc-user-attribute-mapper", + "consentRequired": false, + "config": { + "subjectProperty": "lastName", + "supportedCredentialTypes": "test-credential", + "userAttribute": "lastName" + } + }, + { + "id": "firstName-mapper-001", + "name": "firstName-mapper", + "protocol": "oid4vc", + "protocolMapper": "oid4vc-user-attribute-mapper", + "consentRequired": false, + "config": { + "subjectProperty": "firstName", + "supportedCredentialTypes": "test-credential", + "userAttribute": "firstName" + } + } + ], + "defaultClientScopes": [], + "optionalClientScopes": [] + }, + { + "id": "41bfc870-a6ba-4a42-b06c-d2838e897960", + "clientId": "openid4vc-rest-api", + "name": "", + "description": "", + "rootUrl": "", + "adminUrl": "", + "baseUrl": "", + "surrogateAuthRequired": false, + "enabled": true, + "alwaysDisplayInConsole": false, + "clientAuthenticatorType": "client-secret", + "secret": "uArydomqOymeF0tBrtipkPYujNNUuDlt", + "redirectUris": [ + "http://localhost:8080/*", + "https://kc-issuer.solutions.adorsys.com/*", + "http://kc-issuer.solutions.adorsys.com/*", + "http://localhost:8080", + "http://back.localhost.com/*" + ], + "webOrigins": [ + "http://kc-issuer.solutions.adorsys.com", + "https://kc-issuer.solutions.adorsys.com" + ], + "notBefore": 0, + "bearerOnly": false, + "consentRequired": false, + "standardFlowEnabled": true, + "implicitFlowEnabled": false, + "directAccessGrantsEnabled": true, + "serviceAccountsEnabled": false, + "publicClient": false, + "frontchannelLogout": false, + "protocol": "openid-connect", + "attributes": { + "client.secret.creation.time": "1719785014", + "client.introspection.response.allow.jwt.claim.enabled": "false", + "login_theme": "keycloak", + "post.logout.redirect.uris": "http://localhost:8080/*##http://localhost:8080##https://kci-portal.solutions.adorsys.com/*##https://kci-portal.solutions.adorsys.com##http://localhost:5173##http://front.localhost.com", + "oauth2.device.authorization.grant.enabled": "false", + "use.jwks.url": "false", + "backchannel.logout.revoke.offline.tokens": "false", + "use.refresh.tokens": "true", + "realm_client": "false", + "oidc.ciba.grant.enabled": "false", + "client.use.lightweight.access.token.enabled": "false", + "backchannel.logout.session.required": "true", + "client_credentials.use_refresh_token": "false", + "tls.client.certificate.bound.access.tokens": "false", + "require.pushed.authorization.requests": "false", + "acr.loa.map": "{}", + "display.on.consent.screen": "false", + "token.response.type.bearer.lower-case": "false" + }, + "authenticationFlowBindingOverrides": {}, + "fullScopeAllowed": true, + "nodeReRegistrationTimeout": -1, + "defaultClientScopes": [ + "web-origins", + "acr", + "roles", + "profile", + "basic", + "email" + ], + "optionalClientScopes": [ + "address", + "phone", + "offline_access", + "microprofile-jwt" + ] + }, + { + "id": "a77867d6-f462-4fcc-b385-9ae46917d81a", + "clientId": "security-admin-console", + "name": "${client_security-admin-console}", + "rootUrl": "${authAdminUrl}", + "baseUrl": "/admin/master/console/", + "surrogateAuthRequired": false, + "enabled": true, + "alwaysDisplayInConsole": false, + "clientAuthenticatorType": "client-secret", + "redirectUris": [ + "/admin/master/console/*" + ], + "webOrigins": [ + "+" + ], + "notBefore": 0, + "bearerOnly": false, + "consentRequired": false, + "standardFlowEnabled": true, + "implicitFlowEnabled": false, + "directAccessGrantsEnabled": false, + "serviceAccountsEnabled": false, + "publicClient": true, + "frontchannelLogout": false, + "protocol": "openid-connect", + "attributes": { + "realm_client": "false", + "post.logout.redirect.uris": "+", + "pkce.code.challenge.method": "S256" + }, + "authenticationFlowBindingOverrides": {}, + "fullScopeAllowed": false, + "nodeReRegistrationTimeout": 0, + "protocolMappers": [ + { + "id": "6d047f63-f40a-4986-92c0-5e85284f240e", + "name": "locale", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "introspection.token.claim": "true", + "userinfo.token.claim": "true", + "user.attribute": "locale", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "locale", + "jsonType.label": "String" + } + } + ], + "defaultClientScopes": [ + "web-origins", + "acr", + "roles", + "profile", + "basic", + "email" + ], + "optionalClientScopes": [ + "address", + "phone", + "offline_access", + "microprofile-jwt" + ] + } + ], + "clientScopes": [ + { + "id": "9f8370cc-821b-4c36-ad46-76e9ab342d6b", + "name": "address", + "description": "OpenID Connect built-in scope: address", + "protocol": "openid-connect", + "attributes": { + "include.in.token.scope": "true", + "display.on.consent.screen": "true", + "consent.screen.text": "${addressScopeConsentText}" + }, + "protocolMappers": [ + { + "id": "2657cab4-10f1-409e-8055-acb17330fa48", + "name": "address", + "protocol": "openid-connect", + "protocolMapper": "oidc-address-mapper", + "consentRequired": false, + "config": { + "user.attribute.formatted": "formatted", + "user.attribute.country": "country", + "introspection.token.claim": "true", + "user.attribute.postal_code": "postal_code", + "userinfo.token.claim": "true", + "user.attribute.street": "street", + "id.token.claim": "true", + "user.attribute.region": "region", + "access.token.claim": "true", + "user.attribute.locality": "locality" + } + } + ] + }, + { + "id": "bceb0870-4236-4374-97ab-522cae9af934", + "name": "roles", + "description": "OpenID Connect scope for add user roles to the access token", + "protocol": "openid-connect", + "attributes": { + "include.in.token.scope": "false", + "display.on.consent.screen": "true", + "consent.screen.text": "${rolesScopeConsentText}" + }, + "protocolMappers": [ + { + "id": "1d42f9fa-a7a4-4a72-b4d8-461fb1703b8e", + "name": "realm roles", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-realm-role-mapper", + "consentRequired": false, + "config": { + "introspection.token.claim": "true", + "multivalued": "true", + "user.attribute": "foo", + "access.token.claim": "true", + "claim.name": "realm_access.roles", + "jsonType.label": "String" + } + }, + { + "id": "c6345ea9-5035-415b-a47e-56dd4c791be7", + "name": "audience resolve", + "protocol": "openid-connect", + "protocolMapper": "oidc-audience-resolve-mapper", + "consentRequired": false, + "config": { + "introspection.token.claim": "true", + "access.token.claim": "true" + } + }, + { + "id": "7b7d5204-f13b-4984-8f65-e000bafbead9", + "name": "client roles", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-client-role-mapper", + "consentRequired": false, + "config": { + "introspection.token.claim": "true", + "multivalued": "true", + "user.attribute": "foo", + "access.token.claim": "true", + "claim.name": "resource_access.${client_id}.roles", + "jsonType.label": "String" + } + } + ] + }, + { + "id": "02b77c06-9ddb-4a19-b918-4e2ed25745f5", + "name": "web-origins", + "description": "OpenID Connect scope for add allowed web origins to the access token", + "protocol": "openid-connect", + "attributes": { + "include.in.token.scope": "false", + "display.on.consent.screen": "false", + "consent.screen.text": "" + }, + "protocolMappers": [ + { + "id": "038bfd9a-7e4e-4e12-b162-a606ece531e5", + "name": "allowed web origins", + "protocol": "openid-connect", + "protocolMapper": "oidc-allowed-origins-mapper", + "consentRequired": false, + "config": { + "introspection.token.claim": "true", + "access.token.claim": "true" + } + } + ] + }, + { + "id": "c5c1a6da-e14a-49ca-a73a-e2eab46859f0", + "name": "basic", + "description": "OpenID Connect scope for add all basic claims to the token", + "protocol": "openid-connect", + "attributes": { + "include.in.token.scope": "false", + "display.on.consent.screen": "false" + }, + "protocolMappers": [ + { + "id": "acdd1269-d435-4366-b28a-d8af5c3083fb", + "name": "auth_time", + "protocol": "openid-connect", + "protocolMapper": "oidc-usersessionmodel-note-mapper", + "consentRequired": false, + "config": { + "user.session.note": "AUTH_TIME", + "introspection.token.claim": "true", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "auth_time", + "jsonType.label": "long" + } + }, + { + "id": "d4e3431d-19e4-4277-85ee-02b71ba8ec94", + "name": "sub", + "protocol": "openid-connect", + "protocolMapper": "oidc-sub-mapper", + "consentRequired": false, + "config": { + "introspection.token.claim": "true", + "access.token.claim": "true" + } + } + ] + }, + { + "id": "4988d0ba-7f34-4ee8-a1f3-bdde3b4f8467", + "name": "offline_access", + "description": "OpenID Connect built-in scope: offline_access", + "protocol": "openid-connect", + "attributes": { + "consent.screen.text": "${offlineAccessScopeConsentText}", + "display.on.consent.screen": "true" + } + }, + { + "id": "0c2b58ca-4a85-441c-a1f4-b08e8d5d059c", + "name": "microprofile-jwt", + "description": "Microprofile - JWT built-in scope", + "protocol": "openid-connect", + "attributes": { + "include.in.token.scope": "true", + "display.on.consent.screen": "false" + }, + "protocolMappers": [ + { + "id": "5625348f-9c24-452c-baaf-4b98d7493295", + "name": "groups", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-realm-role-mapper", + "consentRequired": false, + "config": { + "introspection.token.claim": "true", + "multivalued": "true", + "user.attribute": "foo", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "groups", + "jsonType.label": "String" + } + }, + { + "id": "31ebcf7f-0835-4821-a3cd-fe76f57179f0", + "name": "upn", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "introspection.token.claim": "true", + "userinfo.token.claim": "true", + "user.attribute": "username", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "upn", + "jsonType.label": "String" + } + } + ] + }, + { + "id": "0d037831-9cd9-47d8-bb2e-1ac89c7ad646", + "name": "acr", + "description": "OpenID Connect scope for add acr (authentication context class reference) to the token", + "protocol": "openid-connect", + "attributes": { + "include.in.token.scope": "false", + "display.on.consent.screen": "false" + }, + "protocolMappers": [ + { + "id": "46a4876a-f5df-446a-8fe6-0a2a5a174277", + "name": "acr loa level", + "protocol": "openid-connect", + "protocolMapper": "oidc-acr-mapper", + "consentRequired": false, + "config": { + "id.token.claim": "true", + "introspection.token.claim": "true", + "access.token.claim": "true" + } + } + ] + }, + { + "id": "64fff3a6-fc59-407f-8167-180ff69569c0", + "name": "oid4vc_natural_person", + "description": "OIDC$VP Scope, that adds all properties required for a natural person.", + "protocol": "oid4vc", + "attributes": {}, + "protocolMappers": [ + { + "id": "af8db362-4d61-4e4b-b22a-7d618b7f3f97", + "name": "client roles", + "protocol": "oid4vc", + "protocolMapper": "oid4vc-target-role-mapper", + "consentRequired": false, + "config": { + "subjectProperty": "roles", + "clientId": "id" + } + }, + { + "id": "46dec389-3717-4110-95c2-dfb1a86a84ca", + "name": "subject id", + "protocol": "oid4vc", + "protocolMapper": "oid4vc-subject-id-mapper", + "consentRequired": false, + "config": { + "supportedCredentialTypes": "VerifiableCredential", + "subjectIdProperty": "id" + } + }, + { + "id": "52ae1fff-92b7-449b-a144-a4707af4fe62", + "name": "email", + "protocol": "oid4vc", + "protocolMapper": "oid4vc-user-attribute-mapper", + "consentRequired": false, + "config": { + "subjectProperty": "email", + "userAttribute": "email", + "aggregateAttributes": "false" + } + }, + { + "id": "0ffe3871-1f22-42fd-89cd-613ab3848817", + "name": "last-name", + "protocol": "oid4vc", + "protocolMapper": "oid4vc-user-attribute-mapper", + "consentRequired": false, + "config": { + "subjectProperty": "familyName", + "userAttribute": "lastName", + "aggregateAttributes": "false" + } + }, + { + "id": "c167717c-57b7-45f6-bc95-d955836b7cc3", + "name": "first-name", + "protocol": "oid4vc", + "protocolMapper": "oid4vc-user-attribute-mapper", + "consentRequired": false, + "config": { + "subjectProperty": "firstName", + "userAttribute": "firstName", + "aggregateAttributes": "false" + } + } + ] + }, + { + "id": "641451ab-8333-4800-9d13-22c1a2cf7022", + "name": "role_list", + "description": "SAML role list", + "protocol": "saml", + "attributes": { + "consent.screen.text": "${samlRoleListScopeConsentText}", + "display.on.consent.screen": "true" + }, + "protocolMappers": [ + { + "id": "08bd43ac-39c5-43bd-acdb-001a5c0ee630", + "name": "role list", + "protocol": "saml", + "protocolMapper": "saml-role-list-mapper", + "consentRequired": false, + "config": { + "single": "false", + "attribute.nameformat": "Basic", + "attribute.name": "Role" + } + } + ] + }, + { + "id": "316729a5-4dad-46b2-bbcf-882dcb4c6f21", + "name": "email", + "description": "OpenID Connect built-in scope: email", + "protocol": "openid-connect", + "attributes": { + "include.in.token.scope": "true", + "display.on.consent.screen": "true", + "consent.screen.text": "${emailScopeConsentText}" + }, + "protocolMappers": [ + { + "id": "5e4fdc5a-0cbd-42d2-b9b8-37482899b06d", + "name": "email", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "introspection.token.claim": "true", + "userinfo.token.claim": "true", + "user.attribute": "email", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "email", + "jsonType.label": "String" + } + }, + { + "id": "0daf9beb-953f-4170-bd83-eb117dd920db", + "name": "email verified", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-property-mapper", + "consentRequired": false, + "config": { + "introspection.token.claim": "true", + "userinfo.token.claim": "true", + "user.attribute": "emailVerified", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "email_verified", + "jsonType.label": "boolean" + } + } + ] + }, + { + "id": "f568970c-092e-4c17-be49-df8e553d8665", + "name": "profile", + "description": "OpenID Connect built-in scope: profile", + "protocol": "openid-connect", + "attributes": { + "include.in.token.scope": "true", + "display.on.consent.screen": "true", + "consent.screen.text": "${profileScopeConsentText}" + }, + "protocolMappers": [ + { + "id": "b452070b-b20b-4d94-b64e-72624e031dd5", + "name": "nickname", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "introspection.token.claim": "true", + "userinfo.token.claim": "true", + "user.attribute": "nickname", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "nickname", + "jsonType.label": "String" + } + }, + { + "id": "2c4f2126-7c83-4a72-8593-dd50f661269c", + "name": "locale", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "introspection.token.claim": "true", + "userinfo.token.claim": "true", + "user.attribute": "locale", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "locale", + "jsonType.label": "String" + } + }, + { + "id": "0da2ec2f-c90e-439d-ad85-5ce8ec9b8dda", + "name": "updated at", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "introspection.token.claim": "true", + "userinfo.token.claim": "true", + "user.attribute": "updatedAt", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "updated_at", + "jsonType.label": "long" + } + }, + { + "id": "d8564c45-37f2-4058-b258-7a19fda14b7b", + "name": "zoneinfo", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "introspection.token.claim": "true", + "userinfo.token.claim": "true", + "user.attribute": "zoneinfo", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "zoneinfo", + "jsonType.label": "String" + } + }, + { + "id": "bb080577-bfed-4469-9084-940a6131c2d3", + "name": "full name", + "protocol": "openid-connect", + "protocolMapper": "oidc-full-name-mapper", + "consentRequired": false, + "config": { + "id.token.claim": "true", + "introspection.token.claim": "true", + "access.token.claim": "true", + "userinfo.token.claim": "true" + } + }, + { + "id": "c9e6bde9-3085-463c-a7c4-5e626bd1336a", + "name": "birthdate", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "introspection.token.claim": "true", + "userinfo.token.claim": "true", + "user.attribute": "birthdate", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "birthdate", + "jsonType.label": "String" + } + }, + { + "id": "f4ccd340-9fcc-4836-ba26-081235770a85", + "name": "website", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "introspection.token.claim": "true", + "userinfo.token.claim": "true", + "user.attribute": "website", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "website", + "jsonType.label": "String" + } + }, + { + "id": "2275c340-0f8d-439b-b9c3-831f568a5bbf", + "name": "gender", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "introspection.token.claim": "true", + "userinfo.token.claim": "true", + "user.attribute": "gender", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "gender", + "jsonType.label": "String" + } + }, + { + "id": "74a75e37-2a30-422d-89e5-584c874c3dbf", + "name": "username", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "introspection.token.claim": "true", + "userinfo.token.claim": "true", + "user.attribute": "username", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "preferred_username", + "jsonType.label": "String" + } + }, + { + "id": "46ac4bc7-ab16-4bf6-a67f-781f9e3a91a1", + "name": "family name", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "introspection.token.claim": "true", + "userinfo.token.claim": "true", + "user.attribute": "lastName", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "family_name", + "jsonType.label": "String" + } + }, + { + "id": "7840fb53-27c4-4550-aa5b-e0e8c640ca98", + "name": "middle name", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "introspection.token.claim": "true", + "userinfo.token.claim": "true", + "user.attribute": "middleName", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "middle_name", + "jsonType.label": "String" + } + }, + { + "id": "96287c47-f76b-4367-b02a-0e97786796fe", + "name": "given name", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "introspection.token.claim": "true", + "userinfo.token.claim": "true", + "user.attribute": "firstName", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "given_name", + "jsonType.label": "String" + } + }, + { + "id": "b6862c35-1c71-47ed-a901-6fb579eab445", + "name": "picture", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "introspection.token.claim": "true", + "userinfo.token.claim": "true", + "user.attribute": "picture", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "picture", + "jsonType.label": "String" + } + }, + { + "id": "32dff17b-0ebf-4e84-b975-0412e5876c11", + "name": "profile", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "introspection.token.claim": "true", + "userinfo.token.claim": "true", + "user.attribute": "profile", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "profile", + "jsonType.label": "String" + } + } + ] + }, + { + "id": "b265bd92-97f3-4c56-a586-c476af4dfa29", + "name": "phone", + "description": "OpenID Connect built-in scope: phone", + "protocol": "openid-connect", + "attributes": { + "include.in.token.scope": "true", + "display.on.consent.screen": "true", + "consent.screen.text": "${phoneScopeConsentText}" + }, + "protocolMappers": [ + { + "id": "31ae1159-2376-41d4-a946-c1bef49fcac4", + "name": "phone number", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "introspection.token.claim": "true", + "userinfo.token.claim": "true", + "user.attribute": "phoneNumber", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "phone_number", + "jsonType.label": "String" + } + }, + { + "id": "b0d8113b-4a03-407a-b52e-a921a9d49ffe", + "name": "phone number verified", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "introspection.token.claim": "true", + "userinfo.token.claim": "true", + "user.attribute": "phoneNumberVerified", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "phone_number_verified", + "jsonType.label": "boolean" + } + } + ] + } + ], + "defaultDefaultClientScopes": [ + "oid4vc_natural_person", + "role_list", + "profile", + "email", + "roles", + "web-origins", + "acr", + "basic" + ], + "defaultOptionalClientScopes": [ + "offline_access", + "address", + "phone", + "microprofile-jwt" + ], + "browserSecurityHeaders": { + "contentSecurityPolicyReportOnly": "", + "xContentTypeOptions": "nosniff", + "referrerPolicy": "no-referrer", + "xRobotsTag": "none", + "xFrameOptions": "SAMEORIGIN", + "contentSecurityPolicy": "frame-src 'self'; frame-ancestors 'self'; object-src 'none';", + "xXSSProtection": "1; mode=block", + "strictTransportSecurity": "max-age=31536000; includeSubDomains" + }, + "smtpServer": {}, + "eventsEnabled": false, + "eventsListeners": [ + "jboss-logging" + ], + "enabledEventTypes": [], + "adminEventsEnabled": false, + "adminEventsDetailsEnabled": false, + "identityProviders": [], + "identityProviderMappers": [], + "components": { + "org.keycloak.protocol.oid4vc.issuance.signing.VerifiableCredentialsSigningService": [ + { + "id": "sd-jwt-signing_test-credential", + "name": "sd-jwt-signing-service", + "providerId": "vc+sd-jwt", + "subComponents": {}, + "config": { + "algorithmType": [ + "ES256" + ], + "decoys": [ + "2" + ], + "vct": [ + "https://credentials.example.com/test-credential" + ], + "tokenType": [ + "vc+sd-jwt" + ], + "vcConfigId": [ + "test-credential" + ], + "hashAlgorithm": [ + "sha-256" + ] + } + }, + { + "id": "sd-jwt-signing_IdentityCredential", + "name": "sd-jwt-signing-service for IdentityCredential", + "providerId": "vc+sd-jwt", + "subComponents": {}, + "config": { + "algorithmType": [ + "ES256" + ], + "decoys": [ + "2" + ], + "vct": [ + "https://credentials.example.com/identity_credential" + ], + "tokenType": [ + "vc+sd-jwt" + ], + "vcConfigId": [ + "IdentityCredential" + ], + "hashAlgorithm": [ + "sha-256" + ] + } + } + ], + "org.keycloak.services.clientregistration.policy.ClientRegistrationPolicy": [ + { + "id": "7b20642d-3984-4f32-a029-25616b23b8da", + "name": "Allowed Protocol Mapper Types", + "providerId": "allowed-protocol-mappers", + "subType": "authenticated", + "subComponents": {}, + "config": { + "allowed-protocol-mapper-types": [ + "oidc-address-mapper", + "saml-user-attribute-mapper", + "saml-role-list-mapper", + "oidc-usermodel-property-mapper", + "saml-user-property-mapper", + "oidc-sha256-pairwise-sub-mapper", + "oidc-usermodel-attribute-mapper", + "oidc-full-name-mapper" + ] + } + }, + { + "id": "1b0ab51c-8cd9-445b-a674-282012554ecf", + "name": "Consent Required", + "providerId": "consent-required", + "subType": "anonymous", + "subComponents": {}, + "config": {} + }, + { + "id": "30e912d1-d662-41a9-8107-74f2ee7b03b5", + "name": "Max Clients Limit", + "providerId": "max-clients", + "subType": "anonymous", + "subComponents": {}, + "config": { + "max-clients": [ + "200" + ] + } + }, + { + "id": "3003445d-aa1b-4af1-9219-259c8780c35d", + "name": "Trusted Hosts", + "providerId": "trusted-hosts", + "subType": "anonymous", + "subComponents": {}, + "config": { + "host-sending-registration-request-must-match": [ + "true" + ], + "client-uris-must-match": [ + "true" + ] + } + }, + { + "id": "7cd854d1-5229-4722-823d-5fbcf84241c5", + "name": "Full Scope Disabled", + "providerId": "scope", + "subType": "anonymous", + "subComponents": {}, + "config": {} + }, + { + "id": "a1e8adea-de6f-4534-94f3-6f159de43254", + "name": "Allowed Client Scopes", + "providerId": "allowed-client-templates", + "subType": "anonymous", + "subComponents": {}, + "config": { + "allow-default-scopes": [ + "true" + ] + } + }, + { + "id": "eb2cc432-edbe-4633-bc39-1de98ac1ecdc", + "name": "Allowed Protocol Mapper Types", + "providerId": "allowed-protocol-mappers", + "subType": "anonymous", + "subComponents": {}, + "config": { + "allowed-protocol-mapper-types": [ + "saml-role-list-mapper", + "oidc-address-mapper", + "saml-user-property-mapper", + "oidc-usermodel-property-mapper", + "saml-user-attribute-mapper", + "oidc-usermodel-attribute-mapper", + "oidc-full-name-mapper", + "oidc-sha256-pairwise-sub-mapper" + ] + } + }, + { + "id": "b797a45c-1b75-4c48-966b-74a0b6b1dc52", + "name": "Allowed Client Scopes", + "providerId": "allowed-client-templates", + "subType": "authenticated", + "subComponents": {}, + "config": { + "allow-default-scopes": [ + "true" + ] + } + } + ], + "org.keycloak.userprofile.UserProfileProvider": [ + { + "id": "21123e98-32d7-4a2d-be01-b56f4926bd82", + "providerId": "declarative-user-profile", + "subComponents": {}, + "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}},\"permissions\":{\"view\":[\"admin\",\"user\"],\"edit\":[\"admin\",\"user\"]},\"multivalued\":false},{\"name\":\"firstName\",\"displayName\":\"${firstName}\",\"validations\":{\"length\":{\"max\":255},\"person-name-prohibited-characters\":{}},\"permissions\":{\"view\":[\"admin\",\"user\"],\"edit\":[\"admin\",\"user\"]},\"multivalued\":false},{\"name\":\"lastName\",\"displayName\":\"${lastName}\",\"validations\":{\"length\":{\"max\":255},\"person-name-prohibited-characters\":{}},\"permissions\":{\"view\":[\"admin\",\"user\"],\"edit\":[\"admin\",\"user\"]},\"multivalued\":false}],\"groups\":[{\"name\":\"user-metadata\",\"displayHeader\":\"User metadata\",\"displayDescription\":\"Attributes, which refer to user metadata\"}]}" + ] + } + } + ], + "org.keycloak.keys.KeyProvider": [ + { + "id": "53955c0c-a5be-422b-8c71-a6692a7e967a", + "name": "rsa-enc-generated", + "providerId": "rsa-enc-generated", + "subComponents": {}, + "config": { + "active": [ + "false" + ], + "priority": [ + "100" + ], + "algorithm": [ + "RSA-OAEP" + ] + } + }, + { + "id": "rsa-issuer-key", + "name": "rsa-issuer-key", + "providerId": "java-keystore", + "subComponents": {}, + "config": { + "keystorePassword": [ + "store_key_password" + ], + "keyAlias": [ + "rsa_sig_key" + ], + "keystoreType": [ + "PKCS12" + ], + "keyPassword": [ + "store_key_password" + ], + "active": [ + "true" + ], + "keystore": [ + "/home/ubuntu/keycloak-ssi-deployment/target/kc_keystore.pkcs12" + ], + "priority": [ + "0" + ], + "enabled": [ + "true" + ], + "algorithm": [ + "RS256" + ] + } + }, + { + "id": "0ca33a94-84c1-4e07-a4bf-41d3f19a5a8a", + "name": "aes-generated", + "providerId": "aes-generated", + "subComponents": {}, + "config": { + "priority": [ + "100" + ] + } + }, + { + "id": "c352dfd2-27dd-4880-bf1e-1aafef9feba5", + "name": "rsa-generated", + "providerId": "rsa-generated", + "subComponents": {}, + "config": { + "active": [ + "false" + ], + "priority": [ + "100" + ] + } + }, + { + "id": "8da1662d-9dae-4bc3-b201-eb44d666805b", + "name": "hmac-generated-hs512", + "providerId": "hmac-generated", + "subComponents": {}, + "config": { + "priority": [ + "100" + ], + "algorithm": [ + "HS512" + ] + } + }, + { + "id": "rsa-encryption-key", + "name": "rsa-encryption-key", + "providerId": "java-keystore", + "subComponents": {}, + "config": { + "keystorePassword": [ + "store_key_password" + ], + "keyAlias": [ + "rsa_enc_key" + ], + "keyUse": [ + "enc" + ], + "keystoreType": [ + "PKCS12" + ], + "keyPassword": [ + "store_key_password" + ], + "active": [ + "true" + ], + "keystore": [ + "/home/ubuntu/keycloak-ssi-deployment/target/kc_keystore.pkcs12" + ], + "priority": [ + "0" + ], + "enabled": [ + "true" + ], + "algorithm": [ + "RSA-OAEP" + ] + } + }, + { + "id": "ecdsa-issuer-key", + "name": "ecdsa-issuer-key", + "providerId": "java-keystore", + "subComponents": {}, + "config": { + "keystorePassword": [ + "store_key_password" + ], + "keyAlias": [ + "ecdsa_key" + ], + "keystoreType": [ + "PKCS12" + ], + "keyPassword": [ + "store_key_password" + ], + "active": [ + "true" + ], + "keystore": [ + "/home/ubuntu/keycloak-ssi-deployment/target/kc_keystore.pkcs12" + ], + "priority": [ + "0" + ], + "enabled": [ + "true" + ], + "algorithm": [ + "ES256" + ] + } + } + ] + }, + "internationalizationEnabled": false, + "supportedLocales": [], + "authenticationFlows": [ + { + "id": "802d7a7a-4dbc-4e6e-a125-f33a319c9bb3", + "alias": "Account verification options", + "description": "Method with which to verity the existing account", + "providerId": "basic-flow", + "topLevel": false, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "idp-email-verification", + "authenticatorFlow": false, + "requirement": "ALTERNATIVE", + "priority": 10, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticatorFlow": true, + "requirement": "ALTERNATIVE", + "priority": 20, + "autheticatorFlow": true, + "flowAlias": "Verify Existing Account by Re-authentication", + "userSetupAllowed": false + } + ] + }, + { + "id": "a99c0dfe-f73e-4bd5-8c7a-29179bbc8637", + "alias": "Browser - Conditional OTP", + "description": "Flow to determine if the OTP is required for the authentication", + "providerId": "basic-flow", + "topLevel": false, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "conditional-user-configured", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 10, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticator": "auth-otp-form", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 20, + "autheticatorFlow": false, + "userSetupAllowed": false + } + ] + }, + { + "id": "415d9a2f-04c5-4a42-b23c-4c9af0e03d79", + "alias": "Direct Grant - Conditional OTP", + "description": "Flow to determine if the OTP is required for the authentication", + "providerId": "basic-flow", + "topLevel": false, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "conditional-user-configured", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 10, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticator": "direct-grant-validate-otp", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 20, + "autheticatorFlow": false, + "userSetupAllowed": false + } + ] + }, + { + "id": "14f17bb6-d34b-4b8c-a26f-393bd2ca7f14", + "alias": "First broker login - Conditional OTP", + "description": "Flow to determine if the OTP is required for the authentication", + "providerId": "basic-flow", + "topLevel": false, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "conditional-user-configured", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 10, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticator": "auth-otp-form", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 20, + "autheticatorFlow": false, + "userSetupAllowed": false + } + ] + }, + { + "id": "a43e4132-50a4-44f9-a820-43d8f7bb564d", + "alias": "Handle Existing Account", + "description": "Handle what to do if there is existing account with same email/username like authenticated identity provider", + "providerId": "basic-flow", + "topLevel": false, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "idp-confirm-link", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 10, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticatorFlow": true, + "requirement": "REQUIRED", + "priority": 20, + "autheticatorFlow": true, + "flowAlias": "Account verification options", + "userSetupAllowed": false + } + ] + }, + { + "id": "f5407d11-48f4-4c67-9ea3-3ce273f02a69", + "alias": "Reset - Conditional OTP", + "description": "Flow to determine if the OTP should be reset or not. Set to REQUIRED to force.", + "providerId": "basic-flow", + "topLevel": false, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "conditional-user-configured", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 10, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticator": "reset-otp", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 20, + "autheticatorFlow": false, + "userSetupAllowed": false + } + ] + }, + { + "id": "db42e42a-fdd2-4d81-9dee-6b321325ea92", + "alias": "User creation or linking", + "description": "Flow for the existing/non-existing user alternatives", + "providerId": "basic-flow", + "topLevel": false, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticatorConfig": "create unique user config", + "authenticator": "idp-create-user-if-unique", + "authenticatorFlow": false, + "requirement": "ALTERNATIVE", + "priority": 10, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticatorFlow": true, + "requirement": "ALTERNATIVE", + "priority": 20, + "autheticatorFlow": true, + "flowAlias": "Handle Existing Account", + "userSetupAllowed": false + } + ] + }, + { + "id": "491b3929-c88a-4baf-b1eb-9d46263cdc03", + "alias": "Verify Existing Account by Re-authentication", + "description": "Reauthentication of existing account", + "providerId": "basic-flow", + "topLevel": false, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "idp-username-password-form", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 10, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticatorFlow": true, + "requirement": "CONDITIONAL", + "priority": 20, + "autheticatorFlow": true, + "flowAlias": "First broker login - Conditional OTP", + "userSetupAllowed": false + } + ] + }, + { + "id": "ca1b9234-68c3-410b-bf18-4e7afe61e9b7", + "alias": "browser", + "description": "Browser based authentication", + "providerId": "basic-flow", + "topLevel": true, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "auth-cookie", + "authenticatorFlow": false, + "requirement": "ALTERNATIVE", + "priority": 10, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticator": "auth-spnego", + "authenticatorFlow": false, + "requirement": "DISABLED", + "priority": 20, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticator": "identity-provider-redirector", + "authenticatorFlow": false, + "requirement": "ALTERNATIVE", + "priority": 25, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticatorFlow": true, + "requirement": "ALTERNATIVE", + "priority": 30, + "autheticatorFlow": true, + "flowAlias": "forms", + "userSetupAllowed": false + } + ] + }, + { + "id": "86bc7aa1-e6c6-477e-9315-86539b2e4049", + "alias": "clients", + "description": "Base authentication for clients", + "providerId": "client-flow", + "topLevel": true, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "client-secret", + "authenticatorFlow": false, + "requirement": "ALTERNATIVE", + "priority": 10, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticator": "client-jwt", + "authenticatorFlow": false, + "requirement": "ALTERNATIVE", + "priority": 20, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticator": "client-secret-jwt", + "authenticatorFlow": false, + "requirement": "ALTERNATIVE", + "priority": 30, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticator": "client-x509", + "authenticatorFlow": false, + "requirement": "ALTERNATIVE", + "priority": 40, + "autheticatorFlow": false, + "userSetupAllowed": false + } + ] + }, + { + "id": "14fe34a7-e9f6-40d7-a3ab-4135d2c45cde", + "alias": "direct grant", + "description": "OpenID Connect Resource Owner Grant", + "providerId": "basic-flow", + "topLevel": true, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "direct-grant-validate-username", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 10, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticator": "direct-grant-validate-password", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 20, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticatorFlow": true, + "requirement": "CONDITIONAL", + "priority": 30, + "autheticatorFlow": true, + "flowAlias": "Direct Grant - Conditional OTP", + "userSetupAllowed": false + } + ] + }, + { + "id": "b0cffd9a-c915-4d18-b74b-8c77d1c03453", + "alias": "docker auth", + "description": "Used by Docker clients to authenticate against the IDP", + "providerId": "basic-flow", + "topLevel": true, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "docker-http-basic-authenticator", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 10, + "autheticatorFlow": false, + "userSetupAllowed": false + } + ] + }, + { + "id": "ee14fad6-4f2b-4519-9497-e50ad1fe2dd9", + "alias": "first broker login", + "description": "Actions taken after first broker login with identity provider account, which is not yet linked to any Keycloak account", + "providerId": "basic-flow", + "topLevel": true, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticatorConfig": "review profile config", + "authenticator": "idp-review-profile", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 10, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticatorFlow": true, + "requirement": "REQUIRED", + "priority": 20, + "autheticatorFlow": true, + "flowAlias": "User creation or linking", + "userSetupAllowed": false + } + ] + }, + { + "id": "4c498404-7a9f-471a-b7a1-31db05522d37", + "alias": "forms", + "description": "Username, password, otp and other auth forms.", + "providerId": "basic-flow", + "topLevel": false, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "auth-username-password-form", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 10, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticatorFlow": true, + "requirement": "CONDITIONAL", + "priority": 20, + "autheticatorFlow": true, + "flowAlias": "Browser - Conditional OTP", + "userSetupAllowed": false + } + ] + }, + { + "id": "0d06eb26-5750-4dad-a4d5-bfafd933f053", + "alias": "registration", + "description": "Registration flow", + "providerId": "basic-flow", + "topLevel": true, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "registration-page-form", + "authenticatorFlow": true, + "requirement": "REQUIRED", + "priority": 10, + "autheticatorFlow": true, + "flowAlias": "registration form", + "userSetupAllowed": false + } + ] + }, + { + "id": "4280cf9a-eb02-43b7-9ccb-2d6949a11c79", + "alias": "registration form", + "description": "Registration form", + "providerId": "form-flow", + "topLevel": false, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "registration-user-creation", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 20, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticator": "registration-password-action", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 50, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticator": "registration-recaptcha-action", + "authenticatorFlow": false, + "requirement": "DISABLED", + "priority": 60, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticator": "registration-terms-and-conditions", + "authenticatorFlow": false, + "requirement": "DISABLED", + "priority": 70, + "autheticatorFlow": false, + "userSetupAllowed": false + } + ] + }, + { + "id": "d9dbda24-521e-44a4-95ea-4badfa9a2ea6", + "alias": "reset credentials", + "description": "Reset credentials for a user if they forgot their password or something", + "providerId": "basic-flow", + "topLevel": true, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "reset-credentials-choose-user", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 10, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticator": "reset-credential-email", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 20, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticator": "reset-password", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 30, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticatorFlow": true, + "requirement": "CONDITIONAL", + "priority": 40, + "autheticatorFlow": true, + "flowAlias": "Reset - Conditional OTP", + "userSetupAllowed": false + } + ] + }, + { + "id": "2bee36e3-c400-47e2-b08e-0a22d74bb311", + "alias": "saml ecp", + "description": "SAML ECP Profile Authentication Flow", + "providerId": "basic-flow", + "topLevel": true, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "http-basic-authenticator", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 10, + "autheticatorFlow": false, + "userSetupAllowed": false + } + ] + } + ], + "authenticatorConfig": [ + { + "id": "0e8f7111-b742-46b3-863f-d676adf2f97f", + "alias": "create unique user config", + "config": { + "require.password.update.after.registration": "false" + } + }, + { + "id": "57314e9b-ac3a-4f3c-a121-a44a0b94a725", + "alias": "review profile config", + "config": { + "update.profile.on.first.login": "missing" + } + } + ], + "requiredActions": [ + { + "alias": "CONFIGURE_TOTP", + "name": "Configure OTP", + "providerId": "CONFIGURE_TOTP", + "enabled": true, + "defaultAction": false, + "priority": 10, + "config": {} + }, + { + "alias": "TERMS_AND_CONDITIONS", + "name": "Terms and Conditions", + "providerId": "TERMS_AND_CONDITIONS", + "enabled": false, + "defaultAction": false, + "priority": 20, + "config": {} + }, + { + "alias": "UPDATE_PASSWORD", + "name": "Update Password", + "providerId": "UPDATE_PASSWORD", + "enabled": true, + "defaultAction": false, + "priority": 30, + "config": {} + }, + { + "alias": "UPDATE_PROFILE", + "name": "Update Profile", + "providerId": "UPDATE_PROFILE", + "enabled": true, + "defaultAction": false, + "priority": 40, + "config": {} + }, + { + "alias": "VERIFY_EMAIL", + "name": "Verify Email", + "providerId": "VERIFY_EMAIL", + "enabled": true, + "defaultAction": false, + "priority": 50, + "config": {} + }, + { + "alias": "delete_account", + "name": "Delete Account", + "providerId": "delete_account", + "enabled": false, + "defaultAction": false, + "priority": 60, + "config": {} + }, + { + "alias": "webauthn-register", + "name": "Webauthn Register", + "providerId": "webauthn-register", + "enabled": true, + "defaultAction": false, + "priority": 70, + "config": {} + }, + { + "alias": "webauthn-register-passwordless", + "name": "Webauthn Register Passwordless", + "providerId": "webauthn-register-passwordless", + "enabled": true, + "defaultAction": false, + "priority": 80, + "config": {} + }, + { + "alias": "VERIFY_PROFILE", + "name": "Verify Profile", + "providerId": "VERIFY_PROFILE", + "enabled": true, + "defaultAction": false, + "priority": 90, + "config": {} + }, + { + "alias": "delete_credential", + "name": "Delete Credential", + "providerId": "delete_credential", + "enabled": true, + "defaultAction": false, + "priority": 100, + "config": {} + }, + { + "alias": "update_user_locale", + "name": "Update User Locale", + "providerId": "update_user_locale", + "enabled": true, + "defaultAction": false, + "priority": 1000, + "config": {} + } + ], + "browserFlow": "browser", + "registrationFlow": "registration", + "directGrantFlow": "direct grant", + "resetCredentialsFlow": "reset credentials", + "clientAuthenticationFlow": "clients", + "dockerAuthenticationFlow": "docker auth", + "firstBrokerLoginFlow": "first broker login", + "attributes": { + "cibaBackchannelTokenDeliveryMode": "poll", + "cibaAuthRequestedUserHint": "login_hint", + "oauth2DevicePollingInterval": "5", + "clientOfflineSessionMaxLifespan": "0", + "clientSessionIdleTimeout": "0", + "clientOfflineSessionIdleTimeout": "0", + "cibaInterval": "5", + "realmReusableOtpCode": "false", + "cibaExpiresIn": "120", + "oauth2DeviceCodeLifespan": "600", + "parRequestUriLifespan": "60", + "issuerDid": "https://kc-ssi.solutions.adorsys.com/realms/master", + "clientSessionMaxLifespan": "0", + "organizationsEnabled": "false", + "preAuthorizedCodeLifespanS": "120" + }, + "keycloakVersion": "999.0.0-SNAPSHOT", + "userManagedAccessAllowed": false, + "organizationsEnabled": false, + "clientProfiles": { + "profiles": [] + }, + "clientPolicies": { + "policies": [] + } + } \ No newline at end of file From acbaa3decaf7326b08967f2c3033bddab4a1d0fa Mon Sep 17 00:00:00 2001 From: forkimenjeckayang Date: Mon, 9 Sep 2024 14:40:33 +0100 Subject: [PATCH 04/11] Modified the .gitignore file --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index 01000b4..b8365cf 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ signing_service-tmp.json target /.idea/ -config/keycloak-config-cli From 70b79863eb90ab241500b66d9c773d6e1db4e857 Mon Sep 17 00:00:00 2001 From: forkimenjeckayang Date: Mon, 9 Sep 2024 14:52:48 +0100 Subject: [PATCH 05/11] Modified export script and .gitignore --- .gitignore | 1 + config/export_kc_config.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index b8365cf..09129a0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ signing_service-tmp.json target /.idea/ +config/keycloak-config-cli \ No newline at end of file diff --git a/config/export_kc_config.sh b/config/export_kc_config.sh index 6b19ac2..607f427 100755 --- a/config/export_kc_config.sh +++ b/config/export_kc_config.sh @@ -16,7 +16,7 @@ echo "Cloning repository from $REPO_URL..." cd $KC_CLI_DIR && git clone --branch main "$REPO_URL" || { echo "Failed to clone repository"; exit 1; } # Navigate to cloned dir and build CLI tool -cd "$PROJECT_DIR" && mvn clean install -DskipTests || { echo "Failed to build the CLI tool"; exit 1; } +cd "$PROJECT_DIR" && ./mvnw clean install -DskipTests || { echo "Failed to build the CLI tool"; exit 1; } # Check if JAR file is created in the target directory if ls target/*.jar 1> /dev/null 2>&1; then From cb4d22625262ece125f9cb813ab4d5cf2667cae8 Mon Sep 17 00:00:00 2001 From: forkimenjeckayang Date: Mon, 9 Sep 2024 17:41:34 +0100 Subject: [PATCH 06/11] Modified.env file --- .env | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.env b/.env index cb7a6dc..85a52ce 100644 --- a/.env +++ b/.env @@ -97,4 +97,5 @@ KEYCLOAK_URL=https://kc-ssi.solutions.adorsys.com/ KEYCLOAK_USER=$KEYCLOAK_ADMIN KEYCLOAK_PASSWORD=$KEYCLOAK_ADMIN_PASSWORD IMPORT_PATH=$KC_CLI_DIR/realm.json -PROJECT_DIR=$KC_CLI_DIR/keycloak-config-cli \ No newline at end of file +PROJECT_DIR=$KC_CLI_DIR/keycloak-config-cli +KC_KEYSTORE_PATH=$TARGET_DIR/kc_keystore.pkcs12 \ No newline at end of file From 6febe00fe758c741540b4de382a3c7a8b58e5867 Mon Sep 17 00:00:00 2001 From: forkimenjeckayang Date: Mon, 9 Sep 2024 17:42:07 +0100 Subject: [PATCH 07/11] Modified export script and realm.json --- config/export_kc_config.sh | 13 +++++++++++-- config/realm.json | 24 ++++++++++++------------ 2 files changed, 23 insertions(+), 14 deletions(-) diff --git a/config/export_kc_config.sh b/config/export_kc_config.sh index 607f427..69473ba 100755 --- a/config/export_kc_config.sh +++ b/config/export_kc_config.sh @@ -26,12 +26,21 @@ else exit 1 fi +# Define a temporary file to store the modified realm.json +MODIFIED_REALM_JSON="modified_realm.json" + +# Replace the placeholder 'KEYCLOAK_KEYSTORE_PATH' in the realm.json file with the actual value from the .env +sed -e "s|KC_KEYSTORE_PATH|$KC_KEYSTORE_PATH|g" \ + -e "s|KEYCLOAK_KEYSTORE_PASSWORD|$KEYCLOAK_KEYSTORE_PASSWORD|g" \ + -e "s|CLIENT_SECRET|$CLIENT_SECRET|g" \ + $IMPORT_PATH > $MODIFIED_REALM_JSON + # Run the JAR file with the specified parameters echo "Running the JAR file..." java -jar target/$JAR_FILE \ --keycloak.url="$KEYCLOAK_URL" \ --keycloak.user="$KEYCLOAK_USER" \ --keycloak.password="$KEYCLOAK_PASSWORD" \ - --keycloak.ssl-verify="true" \ - --import.files.locations="$IMPORT_PATH" || { echo "Failed to run the JAR file"; exit 1; } + --keycloak.ssl-verify="false" \ + --import.files.locations="$MODIFIED_REALM_JSON" || { echo "Failed to run the JAR file"; exit 1; } echo "Script completed successfully." diff --git a/config/realm.json b/config/realm.json index d933951..a53ee70 100644 --- a/config/realm.json +++ b/config/realm.json @@ -1,6 +1,6 @@ { "id": "a9db380a-6f76-4054-904a-8eecab7db250", - "realm": "test1", + "realm": "master2", "displayName": "Keycloak", "displayNameHtml": "
Keycloak
", "notBefore": 0, @@ -906,7 +906,7 @@ "enabled": true, "alwaysDisplayInConsole": false, "clientAuthenticatorType": "client-secret", - "secret": "uArydomqOymeF0tBrtipkPYujNNUuDlt", + "secret": "CLIENT_SECRET", "redirectUris": [ "http://localhost:8080/*", "https://kc-issuer.solutions.adorsys.com/*", @@ -1912,7 +1912,7 @@ "subComponents": {}, "config": { "keystorePassword": [ - "store_key_password" + "KEYCLOAK_KEYSTORE_PASSWORD" ], "keyAlias": [ "rsa_sig_key" @@ -1921,13 +1921,13 @@ "PKCS12" ], "keyPassword": [ - "store_key_password" + "KEYCLOAK_KEYSTORE_PASSWORD" ], "active": [ "true" ], "keystore": [ - "/home/ubuntu/keycloak-ssi-deployment/target/kc_keystore.pkcs12" + "KC_KEYSTORE_PATH" ], "priority": [ "0" @@ -1986,7 +1986,7 @@ "subComponents": {}, "config": { "keystorePassword": [ - "store_key_password" + "KEYCLOAK_KEYSTORE_PASSWORD" ], "keyAlias": [ "rsa_enc_key" @@ -1998,13 +1998,13 @@ "PKCS12" ], "keyPassword": [ - "store_key_password" + "KEYCLOAK_KEYSTORE_PASSWORD" ], "active": [ "true" ], "keystore": [ - "/home/ubuntu/keycloak-ssi-deployment/target/kc_keystore.pkcs12" + "KC_KEYSTORE_PATH" ], "priority": [ "0" @@ -2024,7 +2024,7 @@ "subComponents": {}, "config": { "keystorePassword": [ - "store_key_password" + "KEYCLOAK_KEYSTORE_PASSWORD" ], "keyAlias": [ "ecdsa_key" @@ -2033,13 +2033,13 @@ "PKCS12" ], "keyPassword": [ - "store_key_password" + "KEYCLOAK_KEYSTORE_PASSWORD" ], "active": [ "true" ], "keystore": [ - "/home/ubuntu/keycloak-ssi-deployment/target/kc_keystore.pkcs12" + "KC_KEYSTORE_PATH" ], "priority": [ "0" @@ -2713,7 +2713,7 @@ "cibaExpiresIn": "120", "oauth2DeviceCodeLifespan": "600", "parRequestUriLifespan": "60", - "issuerDid": "https://kc-ssi.solutions.adorsys.com/realms/master", + "issuerDid": "https://kc-ssi.solutions.adorsys.com//realms/master", "clientSessionMaxLifespan": "0", "organizationsEnabled": "false", "preAuthorizedCodeLifespanS": "120" From effda3de9526a18ff9fc2f58f9986bc57dc5d485 Mon Sep 17 00:00:00 2001 From: forkimenjeckayang Date: Tue, 10 Sep 2024 12:22:40 +0100 Subject: [PATCH 08/11] Modified .env and export config directory for exporting KC configs --- .env | 4 ++-- config/export_kc_config.sh | 7 ++++++- config/realm.json | 4 ++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.env b/.env index 1e40521..444033e 100644 --- a/.env +++ b/.env @@ -93,9 +93,9 @@ KC_START="start --hostname-strict=false --https-port=$KEYCLOAK_HTTPS_PORT --http REPO_URL="https://github.com/adorsys/keycloak-config-cli.git" KC_CLI_DIR=$(pwd)/config JAR_FILE=keycloak-config-cli.jar -KEYCLOAK_URL=https://kc-ssi.solutions.adorsys.com/ +KEYCLOAK_URL=https://localhost:8443/ KEYCLOAK_USER=$KEYCLOAK_ADMIN KEYCLOAK_PASSWORD=$KEYCLOAK_ADMIN_PASSWORD IMPORT_PATH=$KC_CLI_DIR/realm.json PROJECT_DIR=$KC_CLI_DIR/keycloak-config-cli -KC_KEYSTORE_PATH=$TARGET_DIR/kc_keystore.pkcs12 \ No newline at end of file +KC_KEYSTORE_PATH=/opt/keycloak/target/kc_keystore.pkcs12 \ No newline at end of file diff --git a/config/export_kc_config.sh b/config/export_kc_config.sh index 69473ba..49b5d44 100755 --- a/config/export_kc_config.sh +++ b/config/export_kc_config.sh @@ -35,12 +35,17 @@ sed -e "s|KC_KEYSTORE_PATH|$KC_KEYSTORE_PATH|g" \ -e "s|CLIENT_SECRET|$CLIENT_SECRET|g" \ $IMPORT_PATH > $MODIFIED_REALM_JSON +#Save the modified relm file +cat $MODIFIED_REALM_JSON > $WORK_DIR/modified_realm.json + # Run the JAR file with the specified parameters echo "Running the JAR file..." java -jar target/$JAR_FILE \ + -Dimport-realm="true" \ + -Dforce="true" \ --keycloak.url="$KEYCLOAK_URL" \ --keycloak.user="$KEYCLOAK_USER" \ --keycloak.password="$KEYCLOAK_PASSWORD" \ --keycloak.ssl-verify="false" \ --import.files.locations="$MODIFIED_REALM_JSON" || { echo "Failed to run the JAR file"; exit 1; } -echo "Script completed successfully." +echo "Script completed successfully." \ No newline at end of file diff --git a/config/realm.json b/config/realm.json index a53ee70..6050374 100644 --- a/config/realm.json +++ b/config/realm.json @@ -1,6 +1,6 @@ { "id": "a9db380a-6f76-4054-904a-8eecab7db250", - "realm": "master2", + "realm": "testrealm", "displayName": "Keycloak", "displayNameHtml": "
Keycloak
", "notBefore": 0, @@ -2713,7 +2713,7 @@ "cibaExpiresIn": "120", "oauth2DeviceCodeLifespan": "600", "parRequestUriLifespan": "60", - "issuerDid": "https://kc-ssi.solutions.adorsys.com//realms/master", + "issuerDid": "https://localhost:8443/realms/master", "clientSessionMaxLifespan": "0", "organizationsEnabled": "false", "preAuthorizedCodeLifespanS": "120" From c7bb527c0f4564f8019ea5e8ada7d3c29c5b69a1 Mon Sep 17 00:00:00 2001 From: forkimenjeckayang Date: Tue, 10 Sep 2024 17:35:26 +0100 Subject: [PATCH 09/11] Modified the .env and config directory for files concerning KC enviriment config --- .env | 2 +- config/export_kc_config.sh | 6 ++---- config/realm.json | 4 ++-- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.env b/.env index 444033e..735b0d5 100644 --- a/.env +++ b/.env @@ -93,7 +93,7 @@ KC_START="start --hostname-strict=false --https-port=$KEYCLOAK_HTTPS_PORT --http REPO_URL="https://github.com/adorsys/keycloak-config-cli.git" KC_CLI_DIR=$(pwd)/config JAR_FILE=keycloak-config-cli.jar -KEYCLOAK_URL=https://localhost:8443/ +KEYCLOAK_URL=https://kc-ssi.solutions.adorsys.com/ KEYCLOAK_USER=$KEYCLOAK_ADMIN KEYCLOAK_PASSWORD=$KEYCLOAK_ADMIN_PASSWORD IMPORT_PATH=$KC_CLI_DIR/realm.json diff --git a/config/export_kc_config.sh b/config/export_kc_config.sh index 49b5d44..05ead97 100755 --- a/config/export_kc_config.sh +++ b/config/export_kc_config.sh @@ -3,7 +3,7 @@ # Variables source .env -# Check if the CLI project folder alredy exits, if so remove and clone again... +# Check if the CLI project folder already exits, if so remove and clone again... if [ -d "$PROJECT_DIR" ]; then echo "Directory $PROJECT_DIR exists. Removing it..." rm -rf "$PROJECT_DIR" || { echo "Failed to remove directory $PROJECT_DIR"; exit 1; } @@ -35,8 +35,6 @@ sed -e "s|KC_KEYSTORE_PATH|$KC_KEYSTORE_PATH|g" \ -e "s|CLIENT_SECRET|$CLIENT_SECRET|g" \ $IMPORT_PATH > $MODIFIED_REALM_JSON -#Save the modified relm file -cat $MODIFIED_REALM_JSON > $WORK_DIR/modified_realm.json # Run the JAR file with the specified parameters echo "Running the JAR file..." @@ -46,6 +44,6 @@ java -jar target/$JAR_FILE \ --keycloak.url="$KEYCLOAK_URL" \ --keycloak.user="$KEYCLOAK_USER" \ --keycloak.password="$KEYCLOAK_PASSWORD" \ - --keycloak.ssl-verify="false" \ + --keycloak.ssl-verify="true" \ --import.files.locations="$MODIFIED_REALM_JSON" || { echo "Failed to run the JAR file"; exit 1; } echo "Script completed successfully." \ No newline at end of file diff --git a/config/realm.json b/config/realm.json index 6050374..d82b2e2 100644 --- a/config/realm.json +++ b/config/realm.json @@ -1,6 +1,6 @@ { "id": "a9db380a-6f76-4054-904a-8eecab7db250", - "realm": "testrealm", + "realm": "master", "displayName": "Keycloak", "displayNameHtml": "
Keycloak
", "notBefore": 0, @@ -2713,7 +2713,7 @@ "cibaExpiresIn": "120", "oauth2DeviceCodeLifespan": "600", "parRequestUriLifespan": "60", - "issuerDid": "https://localhost:8443/realms/master", + "issuerDid": "https://kc-ssi.solutions.adorsys.com/realms/master", "clientSessionMaxLifespan": "0", "organizationsEnabled": "false", "preAuthorizedCodeLifespanS": "120" From d7e94c7ba4e01ff8122d7d6a680b36597780caab Mon Sep 17 00:00:00 2001 From: forkimenjeckayang Date: Thu, 12 Sep 2024 03:10:38 +0100 Subject: [PATCH 10/11] Modified the .env and export config script --- .env | 16 +++++++++------- config/export_kc_config.sh | 26 ++++++++++++++------------ 2 files changed, 23 insertions(+), 19 deletions(-) diff --git a/.env b/.env index 735b0d5..c5203a5 100644 --- a/.env +++ b/.env @@ -91,11 +91,13 @@ KC_START="start --hostname-strict=false --https-port=$KEYCLOAK_HTTPS_PORT --http # Keycloak config CLI REPO_URL="https://github.com/adorsys/keycloak-config-cli.git" -KC_CLI_DIR=$(pwd)/config -JAR_FILE=keycloak-config-cli.jar +KC_CLI_DIR=$WORK_DIR/config +KC_CLI_JAR_FILE=keycloak-config-cli.jar KEYCLOAK_URL=https://kc-ssi.solutions.adorsys.com/ -KEYCLOAK_USER=$KEYCLOAK_ADMIN -KEYCLOAK_PASSWORD=$KEYCLOAK_ADMIN_PASSWORD -IMPORT_PATH=$KC_CLI_DIR/realm.json -PROJECT_DIR=$KC_CLI_DIR/keycloak-config-cli -KC_KEYSTORE_PATH=/opt/keycloak/target/kc_keystore.pkcs12 \ No newline at end of file +# Use this url when running locally +# KEYCLOAK_URL=https://localhost:8443 +KC_REALM_FILE=$KC_CLI_DIR/realm.json +KC_CLI_PROJECT_DIR=$KC_CLI_DIR/keycloak-config-cli +KC_KEYSTORE_PATH=/opt/keycloak/target/kc_keystore.pkcs12 +# Running locally(without the image) use this path for Keystore file +# KC_KEYSTORE_PATH=$TARGET_DIR/kc_keystore.pkcs12 \ No newline at end of file diff --git a/config/export_kc_config.sh b/config/export_kc_config.sh index 05ead97..e725e43 100755 --- a/config/export_kc_config.sh +++ b/config/export_kc_config.sh @@ -1,12 +1,12 @@ #!/bin/bash # Variables -source .env +source load_env.sh # Check if the CLI project folder already exits, if so remove and clone again... -if [ -d "$PROJECT_DIR" ]; then - echo "Directory $PROJECT_DIR exists. Removing it..." - rm -rf "$PROJECT_DIR" || { echo "Failed to remove directory $PROJECT_DIR"; exit 1; } +if [ -d "$KC_CLI_PROJECT_DIR" ]; then + echo "Directory $KC_CLI_PROJECT_DIR exists. Removing it..." + rm -rf "$KC_CLI_PROJECT_DIR" || { echo "Failed to remove directory $KC_CLI_PROJECT_DIR"; exit 1; } else echo "Directory does not exist" fi @@ -16,7 +16,7 @@ echo "Cloning repository from $REPO_URL..." cd $KC_CLI_DIR && git clone --branch main "$REPO_URL" || { echo "Failed to clone repository"; exit 1; } # Navigate to cloned dir and build CLI tool -cd "$PROJECT_DIR" && ./mvnw clean install -DskipTests || { echo "Failed to build the CLI tool"; exit 1; } +cd "$KC_CLI_PROJECT_DIR" && ./mvnw clean install -DskipTests || { echo "Failed to build the CLI tool"; exit 1; } # Check if JAR file is created in the target directory if ls target/*.jar 1> /dev/null 2>&1; then @@ -29,21 +29,23 @@ fi # Define a temporary file to store the modified realm.json MODIFIED_REALM_JSON="modified_realm.json" -# Replace the placeholder 'KEYCLOAK_KEYSTORE_PATH' in the realm.json file with the actual value from the .env +# Replace the placeholders 'KEYCLOAK_KEYSTORE_PATH','KEYCLOAK_KEYSTORE_PASSWORD' and 'CLIENT_SECRETin' in the realm.json file with the actual value from the .env sed -e "s|KC_KEYSTORE_PATH|$KC_KEYSTORE_PATH|g" \ -e "s|KEYCLOAK_KEYSTORE_PASSWORD|$KEYCLOAK_KEYSTORE_PASSWORD|g" \ -e "s|CLIENT_SECRET|$CLIENT_SECRET|g" \ - $IMPORT_PATH > $MODIFIED_REALM_JSON - + $KC_REALM_FILE > $MODIFIED_REALM_JSON # Run the JAR file with the specified parameters echo "Running the JAR file..." -java -jar target/$JAR_FILE \ +java -jar target/$KC_CLI_JAR_FILE \ -Dimport-realm="true" \ -Dforce="true" \ --keycloak.url="$KEYCLOAK_URL" \ - --keycloak.user="$KEYCLOAK_USER" \ - --keycloak.password="$KEYCLOAK_PASSWORD" \ + --keycloak.user="$KEYCLOAK_ADMIN" \ + --keycloak.password="$KEYCLOAK_ADMIN_PASSWORD" \ --keycloak.ssl-verify="true" \ --import.files.locations="$MODIFIED_REALM_JSON" || { echo "Failed to run the JAR file"; exit 1; } -echo "Script completed successfully." \ No newline at end of file +echo "Script completed successfully." + +#Removing MODIFIED_REALM_JSON form memory +unset MODIFIED_REALM_JSON \ No newline at end of file From aa6851fe2a94b2182e2dc1ee9806a97b1be67d4b Mon Sep 17 00:00:00 2001 From: forkimenjeckayang Date: Thu, 12 Sep 2024 09:22:28 +0100 Subject: [PATCH 11/11] Enhanced export script to remove modified json file --- config/export_kc_config.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/export_kc_config.sh b/config/export_kc_config.sh index e725e43..5f8f246 100755 --- a/config/export_kc_config.sh +++ b/config/export_kc_config.sh @@ -47,5 +47,5 @@ java -jar target/$KC_CLI_JAR_FILE \ --import.files.locations="$MODIFIED_REALM_JSON" || { echo "Failed to run the JAR file"; exit 1; } echo "Script completed successfully." -#Removing MODIFIED_REALM_JSON form memory -unset MODIFIED_REALM_JSON \ No newline at end of file +# If everything is successful, delete the modified realm file +rm -f "$MODIFIED_REALM_JSON"