diff --git a/.gitignore b/.gitignore index b165a951..50ec4bb3 100644 --- a/.gitignore +++ b/.gitignore @@ -44,4 +44,6 @@ private/keys/* /.env -certificates \ No newline at end of file +seeds/pocket-id/*.db + +certificates diff --git a/Makefile b/Makefile index 47beef2b..2f6b1f93 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,28 @@ CLUSTER_SCRIPT=docker/entrypoints/app-dev-entrypoint.sh up: - @bash $(CLUSTER_SCRIPT) \ No newline at end of file + @bash $(CLUSTER_SCRIPT) + +seed-keycloak: + @[ $$(ls -1 seeds/keycloak/*.json 2>/dev/null | wc -l) -gt 0 ] || (echo "No realm export found in seeds/keycloak. Add an export from Keycloak first."; exit 1) + @docker compose -f docker-compose.func.yml stop keycloak >/dev/null 2>&1 || true + @docker compose -f docker-compose.func.yml rm -f -s keycloak >/dev/null 2>&1 || true + @docker volume rm portabase-dev-func_keycloak-data >/dev/null 2>&1 || true + @docker compose -f docker-compose.func.yml up -d keycloak + @echo "Keycloak seed import triggered from seeds/keycloak/*.json" + +seed-pocket: + @[ -f seeds/pocket-id/portabase.zip ] || (echo "No export found in seeds/pocket-id. Add an export from Pocket ID first."; exit 1) + @docker compose -f docker-compose.func.yml stop pocket-id >/dev/null 2>&1 || true + @docker compose -f docker-compose.func.yml rm -f -s pocket-id >/dev/null 2>&1 || true + @docker volume rm portabase-dev-func_pocket-id-data >/dev/null 2>&1 || true + @docker compose -f docker-compose.func.yml run --rm -v ./seeds/pocket-id/portabase.zip:/tmp/portabase.zip pocket-id ./pocket-id import --yes --path /tmp/portabase.zip >/dev/null + @docker compose -f docker-compose.func.yml up -d pocket-id + @sleep 2 + @docker compose -f docker-compose.func.yml exec pocket-id ./pocket-id one-time-access-token admin + @echo "Pocket ID data restored from seeds/pocket-id/portabase.zip" + +seed-auth: seed-keycloak seed-pocket-id + +pocket-id-token: + @docker compose -f docker-compose.func.yml exec pocket-id /app/pocket-id one-time-access-token admin diff --git a/README.md b/README.md index 6d955ede..eaac968b 100644 --- a/README.md +++ b/README.md @@ -87,4 +87,3 @@ Distributed under the Apache License. See `LICENSE.txt` for more details. [ShadcnUI-url]: https://ui.shadcn.com/ [Docker-url]: https://www.docker.com/ - diff --git a/docker-compose.func.yml b/docker-compose.func.yml index 1cf6d7e6..b51a9a04 100644 --- a/docker-compose.func.yml +++ b/docker-compose.func.yml @@ -3,7 +3,7 @@ name: portabase-dev-func services: keycloak: image: quay.io/keycloak/keycloak:latest - command: start-dev + command: start-dev --import-realm environment: KC_BOOTSTRAP_ADMIN_USERNAME: admin KC_BOOTSTRAP_ADMIN_PASSWORD: admin @@ -11,6 +11,8 @@ services: - "8080:8080" volumes: - keycloak-data:/opt/keycloak/data + - ./seeds/keycloak:/opt/keycloak/data/import:ro + - ./export:/tmp/export pocket-id: image: ghcr.io/pocket-id/pocket-id restart: unless-stopped @@ -21,6 +23,7 @@ services: - 3055:1411 volumes: - pocket-id-data:/app/data + - ./seeds/pocket-id:/seed:ro healthcheck: test: "curl -f http://localhost:1411/healthz" interval: 1m30s diff --git a/seeds/keycloak/.gitkeep b/seeds/keycloak/.gitkeep new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/seeds/keycloak/.gitkeep @@ -0,0 +1 @@ + diff --git a/seeds/keycloak/portabase.json b/seeds/keycloak/portabase.json new file mode 100644 index 00000000..0131f3e9 --- /dev/null +++ b/seeds/keycloak/portabase.json @@ -0,0 +1,2216 @@ +{ + "id" : "fb9cf3e7-ba35-48d2-b40e-8a48a98f8acd", + "realm" : "master", + "displayName" : "Portabase", + "displayNameHtml" : "
Portabase
", + "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, + "bruteForceStrategy" : "MULTIPLE", + "maxFailureWaitSeconds" : 900, + "minimumQuickLoginWaitSeconds" : 60, + "waitIncrementSeconds" : 60, + "quickLoginCheckMilliSeconds" : 1000, + "maxDeltaTimeSeconds" : 43200, + "failureFactor" : 30, + "roles" : { + "realm" : [ { + "id" : "e2068803-d2fb-4955-928d-35afa1b552cf", + "name" : "admin", + "description" : "${role_admin}", + "composite" : true, + "composites" : { + "realm" : [ "create-realm" ], + "client" : { + "master-realm" : [ "create-client", "view-users", "query-realms", "view-authorization", "view-identity-providers", "query-users", "query-groups", "manage-users", "manage-events", "view-clients", "view-realm", "manage-authorization", "manage-realm", "view-events", "impersonation", "query-clients", "manage-identity-providers", "manage-clients" ] + } + }, + "clientRole" : false, + "containerId" : "fb9cf3e7-ba35-48d2-b40e-8a48a98f8acd", + "attributes" : { } + }, { + "id" : "1c6d4bb7-a9f0-4bf8-9780-d97e99de3c3d", + "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" : "fb9cf3e7-ba35-48d2-b40e-8a48a98f8acd", + "attributes" : { } + }, { + "id" : "26712408-59c8-463f-bce1-d8f961b4bf51", + "name" : "create-realm", + "description" : "${role_create-realm}", + "composite" : false, + "clientRole" : false, + "containerId" : "fb9cf3e7-ba35-48d2-b40e-8a48a98f8acd", + "attributes" : { } + }, { + "id" : "546e3598-8de5-4e05-8823-5abe2efebf43", + "name" : "offline_access", + "description" : "${role_offline-access}", + "composite" : false, + "clientRole" : false, + "containerId" : "fb9cf3e7-ba35-48d2-b40e-8a48a98f8acd", + "attributes" : { } + }, { + "id" : "b8bf1864-b840-4377-9f6f-373a7f645dcc", + "name" : "uma_authorization", + "description" : "${role_uma_authorization}", + "composite" : false, + "clientRole" : false, + "containerId" : "fb9cf3e7-ba35-48d2-b40e-8a48a98f8acd", + "attributes" : { } + } ], + "client" : { + "portabase" : [ { + "id" : "180dc40c-1c09-49a2-a86b-782f1a2182c4", + "name" : "uma_protection", + "composite" : false, + "clientRole" : true, + "containerId" : "7b8c7b35-8ffd-47b3-82b5-b152b521cd77", + "attributes" : { } + } ], + "security-admin-console" : [ ], + "admin-cli" : [ ], + "account-console" : [ ], + "broker" : [ { + "id" : "695d4423-e83d-403f-baf1-35076a456366", + "name" : "read-token", + "description" : "${role_read-token}", + "composite" : false, + "clientRole" : true, + "containerId" : "af9b43bb-1902-4ed8-b4f6-caa7ec27efd5", + "attributes" : { } + } ], + "master-realm" : [ { + "id" : "27fbd47b-0350-4f11-a83c-a0134f9079b1", + "name" : "create-client", + "description" : "${role_create-client}", + "composite" : false, + "clientRole" : true, + "containerId" : "6022c206-5f1f-45b7-af07-74ce6804cbc7", + "attributes" : { } + }, { + "id" : "672a49fe-69f9-4371-b945-8bb539a76fa7", + "name" : "view-users", + "description" : "${role_view-users}", + "composite" : true, + "composites" : { + "client" : { + "master-realm" : [ "query-users", "query-groups" ] + } + }, + "clientRole" : true, + "containerId" : "6022c206-5f1f-45b7-af07-74ce6804cbc7", + "attributes" : { } + }, { + "id" : "3df2803b-1be3-4446-ad55-de4a1654f0f1", + "name" : "query-realms", + "description" : "${role_query-realms}", + "composite" : false, + "clientRole" : true, + "containerId" : "6022c206-5f1f-45b7-af07-74ce6804cbc7", + "attributes" : { } + }, { + "id" : "963cdf89-9884-493f-b553-d095a190db70", + "name" : "view-authorization", + "description" : "${role_view-authorization}", + "composite" : false, + "clientRole" : true, + "containerId" : "6022c206-5f1f-45b7-af07-74ce6804cbc7", + "attributes" : { } + }, { + "id" : "0c7db742-fb5a-41ca-816a-ade107446ee8", + "name" : "view-identity-providers", + "description" : "${role_view-identity-providers}", + "composite" : false, + "clientRole" : true, + "containerId" : "6022c206-5f1f-45b7-af07-74ce6804cbc7", + "attributes" : { } + }, { + "id" : "9741b23a-9efa-4fbc-bfae-683f84997e8b", + "name" : "query-users", + "description" : "${role_query-users}", + "composite" : false, + "clientRole" : true, + "containerId" : "6022c206-5f1f-45b7-af07-74ce6804cbc7", + "attributes" : { } + }, { + "id" : "65439bfe-de32-499f-9f68-44ecd96ff49c", + "name" : "query-groups", + "description" : "${role_query-groups}", + "composite" : false, + "clientRole" : true, + "containerId" : "6022c206-5f1f-45b7-af07-74ce6804cbc7", + "attributes" : { } + }, { + "id" : "ecaab7fc-da4b-4613-8b7c-959ed4e225cc", + "name" : "manage-events", + "description" : "${role_manage-events}", + "composite" : false, + "clientRole" : true, + "containerId" : "6022c206-5f1f-45b7-af07-74ce6804cbc7", + "attributes" : { } + }, { + "id" : "e260a5cc-91c5-41db-86f8-01b494c4e66b", + "name" : "manage-users", + "description" : "${role_manage-users}", + "composite" : false, + "clientRole" : true, + "containerId" : "6022c206-5f1f-45b7-af07-74ce6804cbc7", + "attributes" : { } + }, { + "id" : "db6d0e0a-4193-4f6a-9343-d1f182fdda15", + "name" : "view-clients", + "description" : "${role_view-clients}", + "composite" : true, + "composites" : { + "client" : { + "master-realm" : [ "query-clients" ] + } + }, + "clientRole" : true, + "containerId" : "6022c206-5f1f-45b7-af07-74ce6804cbc7", + "attributes" : { } + }, { + "id" : "f8bc7291-d450-48f6-820e-67a8ab2a6b5b", + "name" : "view-realm", + "description" : "${role_view-realm}", + "composite" : false, + "clientRole" : true, + "containerId" : "6022c206-5f1f-45b7-af07-74ce6804cbc7", + "attributes" : { } + }, { + "id" : "3444137f-0938-4340-9d5b-ceef2f7b1e97", + "name" : "manage-authorization", + "description" : "${role_manage-authorization}", + "composite" : false, + "clientRole" : true, + "containerId" : "6022c206-5f1f-45b7-af07-74ce6804cbc7", + "attributes" : { } + }, { + "id" : "a39bf436-1fa4-42d2-80ed-a010b43853aa", + "name" : "manage-realm", + "description" : "${role_manage-realm}", + "composite" : false, + "clientRole" : true, + "containerId" : "6022c206-5f1f-45b7-af07-74ce6804cbc7", + "attributes" : { } + }, { + "id" : "baa18f46-7d1d-4298-b3b0-9b0ecb945557", + "name" : "view-events", + "description" : "${role_view-events}", + "composite" : false, + "clientRole" : true, + "containerId" : "6022c206-5f1f-45b7-af07-74ce6804cbc7", + "attributes" : { } + }, { + "id" : "91298b5d-5182-4056-8240-8fdb188f865e", + "name" : "impersonation", + "description" : "${role_impersonation}", + "composite" : false, + "clientRole" : true, + "containerId" : "6022c206-5f1f-45b7-af07-74ce6804cbc7", + "attributes" : { } + }, { + "id" : "a5a58b82-32eb-4c78-993a-cf9c7e37eabb", + "name" : "query-clients", + "description" : "${role_query-clients}", + "composite" : false, + "clientRole" : true, + "containerId" : "6022c206-5f1f-45b7-af07-74ce6804cbc7", + "attributes" : { } + }, { + "id" : "c8c85c54-7bfb-4d45-8ccc-6253e429f649", + "name" : "manage-clients", + "description" : "${role_manage-clients}", + "composite" : false, + "clientRole" : true, + "containerId" : "6022c206-5f1f-45b7-af07-74ce6804cbc7", + "attributes" : { } + }, { + "id" : "baed486e-dc69-44a9-9630-9a88987142ee", + "name" : "manage-identity-providers", + "description" : "${role_manage-identity-providers}", + "composite" : false, + "clientRole" : true, + "containerId" : "6022c206-5f1f-45b7-af07-74ce6804cbc7", + "attributes" : { } + } ], + "account" : [ { + "id" : "8085c714-b840-4539-823d-a8df8bab3db3", + "name" : "view-applications", + "description" : "${role_view-applications}", + "composite" : false, + "clientRole" : true, + "containerId" : "18b5dfb2-44d4-448e-98df-9652daef1a22", + "attributes" : { } + }, { + "id" : "12089b7a-e685-4c87-bb81-997ecc04ed17", + "name" : "view-profile", + "description" : "${role_view-profile}", + "composite" : false, + "clientRole" : true, + "containerId" : "18b5dfb2-44d4-448e-98df-9652daef1a22", + "attributes" : { } + }, { + "id" : "ea9e72d8-1d23-4f50-86b3-1795067da29f", + "name" : "view-groups", + "description" : "${role_view-groups}", + "composite" : false, + "clientRole" : true, + "containerId" : "18b5dfb2-44d4-448e-98df-9652daef1a22", + "attributes" : { } + }, { + "id" : "2bd8114a-75cf-4d6b-8f42-229f6a5c66a0", + "name" : "delete-account", + "description" : "${role_delete-account}", + "composite" : false, + "clientRole" : true, + "containerId" : "18b5dfb2-44d4-448e-98df-9652daef1a22", + "attributes" : { } + }, { + "id" : "7303b334-e9e0-4236-89b8-e1c9d6562138", + "name" : "view-consent", + "description" : "${role_view-consent}", + "composite" : false, + "clientRole" : true, + "containerId" : "18b5dfb2-44d4-448e-98df-9652daef1a22", + "attributes" : { } + }, { + "id" : "12c6fe35-ec80-4ca2-b2a8-9d6eae4c3a92", + "name" : "manage-account-links", + "description" : "${role_manage-account-links}", + "composite" : false, + "clientRole" : true, + "containerId" : "18b5dfb2-44d4-448e-98df-9652daef1a22", + "attributes" : { } + }, { + "id" : "e56b828b-7d5d-49a2-b686-c1bd535900ac", + "name" : "manage-consent", + "description" : "${role_manage-consent}", + "composite" : true, + "composites" : { + "client" : { + "account" : [ "view-consent" ] + } + }, + "clientRole" : true, + "containerId" : "18b5dfb2-44d4-448e-98df-9652daef1a22", + "attributes" : { } + }, { + "id" : "98e19002-4144-48fc-bcca-4ac6f19a6a37", + "name" : "manage-account", + "description" : "${role_manage-account}", + "composite" : true, + "composites" : { + "client" : { + "account" : [ "manage-account-links" ] + } + }, + "clientRole" : true, + "containerId" : "18b5dfb2-44d4-448e-98df-9652daef1a22", + "attributes" : { } + } ] + } + }, + "groups" : [ { + "id" : "f523647e-76b3-493f-bb1e-f2a3f7deebdb", + "name" : "Admin", + "description" : "", + "path" : "/Admin", + "subGroups" : [ ], + "attributes" : { }, + "realmRoles" : [ "admin" ], + "clientRoles" : { } + }, { + "id" : "f3b7286d-8169-41eb-b3a2-6241bf58907d", + "name" : "Default", + "description" : "", + "path" : "/Default", + "subGroups" : [ ], + "attributes" : { }, + "realmRoles" : [ ], + "clientRoles" : { } + }, { + "id" : "eda8d5c9-d29a-4b35-9372-2b088b9a9d8d", + "name" : "Pending", + "description" : "", + "path" : "/Pending", + "subGroups" : [ ], + "attributes" : { }, + "realmRoles" : [ ], + "clientRoles" : { } + } ], + "defaultRole" : { + "id" : "1c6d4bb7-a9f0-4bf8-9780-d97e99de3c3d", + "name" : "default-roles-master", + "description" : "${role_default-roles}", + "composite" : true, + "clientRole" : false, + "containerId" : "fb9cf3e7-ba35-48d2-b40e-8a48a98f8acd" + }, + "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" : "Yes", + "webAuthnPolicyPasswordlessUserVerificationRequirement" : "required", + "webAuthnPolicyPasswordlessCreateTimeout" : 0, + "webAuthnPolicyPasswordlessAvoidSameAuthenticatorRegister" : false, + "webAuthnPolicyPasswordlessAcceptableAaguids" : [ ], + "webAuthnPolicyPasswordlessExtraOrigins" : [ ], + "users" : [ { + "id" : "9bd127a6-a29f-4a3d-a530-9b7284cf9770", + "username" : "admin", + "emailVerified" : false, + "attributes" : { + "is_temporary_admin" : [ "true" ] + }, + "enabled" : true, + "createdTimestamp" : 1772178626982, + "totp" : false, + "credentials" : [ { + "id" : "731ce7c2-9141-4ff1-8856-3e8625cf1929", + "type" : "password", + "createdDate" : 1772178627073, + "secretData" : "{\"value\":\"quuOeVW9VVoilChYLmvjJWCnAM23OA/gK54tYoJ6atw=\",\"salt\":\"khqIggSOfCNLqP1i9qiwvQ==\",\"additionalParameters\":{}}", + "credentialData" : "{\"hashIterations\":5,\"algorithm\":\"argon2\",\"additionalParameters\":{\"hashLength\":[\"32\"],\"memory\":[\"7168\"],\"type\":[\"id\"],\"version\":[\"1.3\"],\"parallelism\":[\"1\"]}}" + } ], + "disableableCredentialTypes" : [ ], + "requiredActions" : [ ], + "realmRoles" : [ "admin", "default-roles-master" ], + "notBefore" : 0, + "groups" : [ ] + }, { + "id" : "c62607eb-fe31-4ea4-b8cb-56c37039c1b3", + "username" : "development", + "firstName" : "Tech", + "lastName" : "Soluce", + "email" : "development@soluce-technologies.com", + "emailVerified" : true, + "enabled" : true, + "createdTimestamp" : 1772179382148, + "totp" : false, + "credentials" : [ { + "id" : "b1cedcac-5207-4479-bc29-065ba849e414", + "type" : "password", + "userLabel" : "My password", + "createdDate" : 1772179391727, + "secretData" : "{\"value\":\"IXr6L3pvO2BAkn/cH3rh3v2tg1R83u2f8SWEZK2fq5E=\",\"salt\":\"XWV8/yKm7Rw/YXiwXZZUig==\",\"additionalParameters\":{}}", + "credentialData" : "{\"hashIterations\":5,\"algorithm\":\"argon2\",\"additionalParameters\":{\"hashLength\":[\"32\"],\"memory\":[\"7168\"],\"type\":[\"id\"],\"version\":[\"1.3\"],\"parallelism\":[\"1\"]}}" + } ], + "disableableCredentialTypes" : [ ], + "requiredActions" : [ ], + "realmRoles" : [ "admin", "default-roles-master" ], + "notBefore" : 0, + "groups" : [ "/Admin" ] + }, { + "id" : "718dfe46-dbef-41a3-9120-78aeac240431", + "username" : "service-account-portabase", + "emailVerified" : false, + "enabled" : true, + "createdTimestamp" : 1772177793553, + "totp" : false, + "serviceAccountClientId" : "portabase", + "credentials" : [ ], + "disableableCredentialTypes" : [ ], + "requiredActions" : [ ], + "realmRoles" : [ "default-roles-master" ], + "clientRoles" : { + "portabase" : [ "uma_protection" ] + }, + "notBefore" : 0, + "groups" : [ ] + } ], + "scopeMappings" : [ { + "clientScope" : "offline_access", + "roles" : [ "offline_access" ] + } ], + "clientScopeMappings" : { + "account" : [ { + "client" : "account-console", + "roles" : [ "manage-account", "view-groups" ] + } ] + }, + "clients" : [ { + "id" : "18b5dfb2-44d4-448e-98df-9652daef1a22", + "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", "profile", "roles", "basic", "email" ], + "optionalClientScopes" : [ "address", "phone", "organization", "offline_access", "microprofile-jwt" ] + }, { + "id" : "b07531b2-43f4-4487-8068-46001dd1abf7", + "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" : "ad646174-e521-4bd5-8f78-eb8eed2befb8", + "name" : "audience resolve", + "protocol" : "openid-connect", + "protocolMapper" : "oidc-audience-resolve-mapper", + "consentRequired" : false, + "config" : { } + } ], + "defaultClientScopes" : [ "web-origins", "acr", "profile", "roles", "basic", "email" ], + "optionalClientScopes" : [ "address", "phone", "organization", "offline_access", "microprofile-jwt" ] + }, { + "id" : "8ad89892-6f85-4f07-b6b6-1fcb1eda58e2", + "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", + "client.use.lightweight.access.token.enabled" : "true", + "post.logout.redirect.uris" : "+" + }, + "authenticationFlowBindingOverrides" : { }, + "fullScopeAllowed" : true, + "nodeReRegistrationTimeout" : 0, + "defaultClientScopes" : [ "web-origins", "acr", "profile", "roles", "basic", "email" ], + "optionalClientScopes" : [ "address", "phone", "organization", "offline_access", "microprofile-jwt" ] + }, { + "id" : "af9b43bb-1902-4ed8-b4f6-caa7ec27efd5", + "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", + "post.logout.redirect.uris" : "+" + }, + "authenticationFlowBindingOverrides" : { }, + "fullScopeAllowed" : false, + "nodeReRegistrationTimeout" : 0, + "defaultClientScopes" : [ "web-origins", "acr", "profile", "roles", "basic", "email" ], + "optionalClientScopes" : [ "address", "phone", "organization", "offline_access", "microprofile-jwt" ] + }, { + "id" : "6022c206-5f1f-45b7-af07-74ce6804cbc7", + "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, + "protocol" : "openid-connect", + "attributes" : { + "realm_client" : "true", + "post.logout.redirect.uris" : "+" + }, + "authenticationFlowBindingOverrides" : { }, + "fullScopeAllowed" : false, + "nodeReRegistrationTimeout" : 0, + "defaultClientScopes" : [ "web-origins", "acr", "profile", "roles", "basic", "email" ], + "optionalClientScopes" : [ "address", "phone", "organization", "offline_access", "microprofile-jwt" ] + }, { + "id" : "7b8c7b35-8ffd-47b3-82b5-b152b521cd77", + "clientId" : "portabase", + "name" : "Portabase", + "description" : "", + "rootUrl" : "http://localhost:8887", + "adminUrl" : "http://localhost:8887", + "baseUrl" : "http://localhost:8887", + "surrogateAuthRequired" : false, + "enabled" : true, + "alwaysDisplayInConsole" : false, + "clientAuthenticatorType" : "client-secret", + "secret" : "**********", + "redirectUris" : [ "http://localhost:8887/api/auth/sso/callback/keycloak" ], + "webOrigins" : [ "http://localhost:8887" ], + "notBefore" : 0, + "bearerOnly" : false, + "consentRequired" : false, + "standardFlowEnabled" : true, + "implicitFlowEnabled" : false, + "directAccessGrantsEnabled" : false, + "serviceAccountsEnabled" : true, + "authorizationServicesEnabled" : true, + "publicClient" : false, + "frontchannelLogout" : true, + "protocol" : "openid-connect", + "attributes" : { + "realm_client" : "false", + "oidc.ciba.grant.enabled" : "false", + "client.secret.creation.time" : "1772177793", + "backchannel.logout.session.required" : "true", + "standard.token.exchange.enabled" : "false", + "post.logout.redirect.uris" : "http://localhost:8887", + "oauth2.device.authorization.grant.enabled" : "true", + "pkce.code.challenge.method" : "S256", + "backchannel.logout.revoke.offline.tokens" : "false", + "dpop.bound.access.tokens" : "false" + }, + "authenticationFlowBindingOverrides" : { }, + "fullScopeAllowed" : true, + "nodeReRegistrationTimeout" : -1, + "protocolMappers" : [ { + "id" : "3e8f8909-e718-4ebe-80b9-ed6501e94cbe", + "name" : "groups", + "protocol" : "openid-connect", + "protocolMapper" : "oidc-group-membership-mapper", + "consentRequired" : false, + "config" : { + "full.path" : "false", + "introspection.token.claim" : "true", + "userinfo.token.claim" : "true", + "multivalued" : "true", + "id.token.claim" : "true", + "lightweight.claim" : "false", + "access.token.claim" : "true", + "claim.name" : "groups" + } + } ], + "defaultClientScopes" : [ "web-origins", "service_account", "acr", "profile", "roles", "basic", "email" ], + "optionalClientScopes" : [ "address", "phone", "organization", "offline_access", "microprofile-jwt" ], + "authorizationSettings" : { + "allowRemoteResourceManagement" : true, + "policyEnforcementMode" : "ENFORCING", + "resources" : [ ], + "policies" : [ ], + "scopes" : [ ], + "decisionStrategy" : "UNANIMOUS" + } + }, { + "id" : "320637e2-0aa2-4601-8862-fe465e887167", + "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", + "client.use.lightweight.access.token.enabled" : "true", + "post.logout.redirect.uris" : "+", + "pkce.code.challenge.method" : "S256" + }, + "authenticationFlowBindingOverrides" : { }, + "fullScopeAllowed" : true, + "nodeReRegistrationTimeout" : 0, + "protocolMappers" : [ { + "id" : "59aa4c07-4e3b-4abd-947c-94e4840aab0f", + "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", "profile", "roles", "basic", "email" ], + "optionalClientScopes" : [ "address", "phone", "organization", "offline_access", "microprofile-jwt" ] + } ], + "clientScopes" : [ { + "id" : "1c5c7377-5552-4f36-8073-5b7c50ba0b58", + "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" : "d26ac380-69ea-47c8-9342-f8108b8b1c7a", + "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" : "47e583ab-95d7-4b9e-83c3-37689f6808ff", + "name" : "groups", + "protocol" : "openid-connect", + "protocolMapper" : "oidc-usermodel-realm-role-mapper", + "consentRequired" : false, + "config" : { + "introspection.token.claim" : "true", + "multivalued" : "true", + "userinfo.token.claim" : "true", + "user.attribute" : "foo", + "id.token.claim" : "true", + "access.token.claim" : "true", + "claim.name" : "groups", + "jsonType.label" : "String" + } + } ] + }, { + "id" : "b92d26a9-7930-4f6c-add6-082374546966", + "name" : "roles", + "description" : "OpenID Connect scope for add user roles to the access token", + "protocol" : "openid-connect", + "attributes" : { + "include.in.token.scope" : "false", + "consent.screen.text" : "${rolesScopeConsentText}", + "display.on.consent.screen" : "true" + }, + "protocolMappers" : [ { + "id" : "0bf151da-a754-460b-bc53-1d78249c3ac1", + "name" : "audience resolve", + "protocol" : "openid-connect", + "protocolMapper" : "oidc-audience-resolve-mapper", + "consentRequired" : false, + "config" : { + "introspection.token.claim" : "true", + "access.token.claim" : "true" + } + }, { + "id" : "a806de62-0e08-456f-9e16-76e8b186c724", + "name" : "realm roles", + "protocol" : "openid-connect", + "protocolMapper" : "oidc-usermodel-realm-role-mapper", + "consentRequired" : false, + "config" : { + "user.attribute" : "foo", + "introspection.token.claim" : "true", + "access.token.claim" : "true", + "claim.name" : "realm_access.roles", + "jsonType.label" : "String", + "multivalued" : "true" + } + }, { + "id" : "9063017e-d52e-4624-acff-22833103a577", + "name" : "client roles", + "protocol" : "openid-connect", + "protocolMapper" : "oidc-usermodel-client-role-mapper", + "consentRequired" : false, + "config" : { + "user.attribute" : "foo", + "introspection.token.claim" : "true", + "access.token.claim" : "true", + "claim.name" : "resource_access.${client_id}.roles", + "jsonType.label" : "String", + "multivalued" : "true" + } + } ] + }, { + "id" : "dce5baba-c90f-4347-8b84-3162868c7ffa", + "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" : "1457d324-6006-4141-b8a7-c45d7ab8814c", + "name" : "auth_time", + "protocol" : "openid-connect", + "protocolMapper" : "oidc-usersessionmodel-note-mapper", + "consentRequired" : false, + "config" : { + "user.session.note" : "AUTH_TIME", + "introspection.token.claim" : "true", + "userinfo.token.claim" : "true", + "id.token.claim" : "true", + "access.token.claim" : "true", + "claim.name" : "auth_time", + "jsonType.label" : "long" + } + }, { + "id" : "0d3b31e5-31f5-4778-adbd-36a06b301af6", + "name" : "sub", + "protocol" : "openid-connect", + "protocolMapper" : "oidc-sub-mapper", + "consentRequired" : false, + "config" : { + "introspection.token.claim" : "true", + "access.token.claim" : "true" + } + } ] + }, { + "id" : "f65dc085-328e-41d8-a3f3-933eed32c804", + "name" : "email", + "description" : "OpenID Connect built-in scope: email", + "protocol" : "openid-connect", + "attributes" : { + "include.in.token.scope" : "true", + "consent.screen.text" : "${emailScopeConsentText}", + "display.on.consent.screen" : "true" + }, + "protocolMappers" : [ { + "id" : "084130d1-642b-4b44-8643-60962e0a01d0", + "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" : "894569d9-bf66-425e-a07e-892e97d4ac3d", + "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" : "ae961041-beb6-4d8e-b9f2-b0a1f88423f6", + "name" : "address", + "description" : "OpenID Connect built-in scope: address", + "protocol" : "openid-connect", + "attributes" : { + "include.in.token.scope" : "true", + "consent.screen.text" : "${addressScopeConsentText}", + "display.on.consent.screen" : "true" + }, + "protocolMappers" : [ { + "id" : "84d4f934-f761-4741-bca5-b48581c6b2de", + "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" : "5e1cf5ad-00e6-4092-b8aa-76bb293a3efa", + "name" : "saml_organization", + "description" : "Organization Membership", + "protocol" : "saml", + "attributes" : { + "display.on.consent.screen" : "false" + }, + "protocolMappers" : [ { + "id" : "10efbc9e-4f21-42b7-832b-f5de7b3a666c", + "name" : "organization", + "protocol" : "saml", + "protocolMapper" : "saml-organization-membership-mapper", + "consentRequired" : false, + "config" : { } + } ] + }, { + "id" : "a1c75182-21f3-4e70-83f4-67e42f28267c", + "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", + "consent.screen.text" : "", + "display.on.consent.screen" : "false" + }, + "protocolMappers" : [ { + "id" : "1a570c6f-6f1a-4503-8677-5762b7b5578a", + "name" : "allowed web origins", + "protocol" : "openid-connect", + "protocolMapper" : "oidc-allowed-origins-mapper", + "consentRequired" : false, + "config" : { + "introspection.token.claim" : "true", + "access.token.claim" : "true" + } + } ] + }, { + "id" : "4e350025-c16f-4a34-b132-4c6c07d0d90f", + "name" : "profile", + "description" : "OpenID Connect built-in scope: profile", + "protocol" : "openid-connect", + "attributes" : { + "include.in.token.scope" : "true", + "consent.screen.text" : "${profileScopeConsentText}", + "display.on.consent.screen" : "true" + }, + "protocolMappers" : [ { + "id" : "7b1a561c-f0d0-4979-ab02-0e9d564cb5af", + "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" : "ed49a16e-928f-4882-a8b6-835b83445349", + "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" : "0fea1c8d-77a9-4325-a414-ca503a702ea1", + "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" : "4ec1df3c-803c-4b3d-a96d-054f17b3745c", + "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" : "b066efb7-76f4-4a42-97ae-39cb8883898a", + "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" : "0ef7cb1a-75f4-4b57-8614-3d35d7f93fc5", + "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" : "dd8c2607-67ab-4f25-96cc-19c9751a0e03", + "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" : "f2fdb527-5bb8-4c41-a260-7b8f2653baa8", + "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" : "672a0701-67a0-4aa4-bbeb-93fa325d2921", + "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" : "a3ca4541-9326-4b34-b59d-5f6f366e2ff9", + "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" : "ccdc393d-6aee-4c88-b071-b708f4cf2b05", + "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" : "cbf3d8ee-c2d9-445d-8662-279fd1160c80", + "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" : "fc8b06a9-e4fc-4381-830a-2e03f8982ff6", + "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" : "a46cc2ac-d92c-4b61-b119-910b4e96e456", + "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" : "2b7175c7-d59b-4dea-9759-405299298c21", + "name" : "organization", + "description" : "Additional claims about the organization a subject belongs to", + "protocol" : "openid-connect", + "attributes" : { + "include.in.token.scope" : "true", + "consent.screen.text" : "${organizationScopeConsentText}", + "display.on.consent.screen" : "true" + }, + "protocolMappers" : [ { + "id" : "cd6a70e3-ebb8-4892-975e-4bece535c387", + "name" : "organization", + "protocol" : "openid-connect", + "protocolMapper" : "oidc-organization-membership-mapper", + "consentRequired" : false, + "config" : { + "introspection.token.claim" : "true", + "multivalued" : "true", + "userinfo.token.claim" : "true", + "id.token.claim" : "true", + "access.token.claim" : "true", + "claim.name" : "organization", + "jsonType.label" : "String" + } + } ] + }, { + "id" : "074912fc-e8b4-4369-8842-d8e44479e5d7", + "name" : "role_list", + "description" : "SAML role list", + "protocol" : "saml", + "attributes" : { + "consent.screen.text" : "${samlRoleListScopeConsentText}", + "display.on.consent.screen" : "true" + }, + "protocolMappers" : [ { + "id" : "8e4761c8-96b5-422b-b9ef-f18970f9a677", + "name" : "role list", + "protocol" : "saml", + "protocolMapper" : "saml-role-list-mapper", + "consentRequired" : false, + "config" : { + "single" : "false", + "attribute.nameformat" : "Basic", + "attribute.name" : "Role" + } + } ] + }, { + "id" : "8b3b526e-ea3d-497a-b346-5852ddd29d01", + "name" : "service_account", + "description" : "Specific scope for a client enabled for service accounts", + "protocol" : "openid-connect", + "attributes" : { + "include.in.token.scope" : "false", + "display.on.consent.screen" : "false" + }, + "protocolMappers" : [ { + "id" : "7e347974-b093-4a66-8fe0-8bdbab526232", + "name" : "Client Host", + "protocol" : "openid-connect", + "protocolMapper" : "oidc-usersessionmodel-note-mapper", + "consentRequired" : false, + "config" : { + "user.session.note" : "clientHost", + "introspection.token.claim" : "true", + "userinfo.token.claim" : "true", + "id.token.claim" : "true", + "access.token.claim" : "true", + "claim.name" : "clientHost", + "jsonType.label" : "String" + } + }, { + "id" : "0a4fe9bc-c5b1-45fc-80c1-7de78eda92ab", + "name" : "Client IP Address", + "protocol" : "openid-connect", + "protocolMapper" : "oidc-usersessionmodel-note-mapper", + "consentRequired" : false, + "config" : { + "user.session.note" : "clientAddress", + "introspection.token.claim" : "true", + "userinfo.token.claim" : "true", + "id.token.claim" : "true", + "access.token.claim" : "true", + "claim.name" : "clientAddress", + "jsonType.label" : "String" + } + }, { + "id" : "9b86ae58-d68d-4be7-9e48-3113a22caf5f", + "name" : "Client ID", + "protocol" : "openid-connect", + "protocolMapper" : "oidc-usersessionmodel-note-mapper", + "consentRequired" : false, + "config" : { + "user.session.note" : "client_id", + "introspection.token.claim" : "true", + "userinfo.token.claim" : "true", + "id.token.claim" : "true", + "access.token.claim" : "true", + "claim.name" : "client_id", + "jsonType.label" : "String" + } + } ] + }, { + "id" : "09e32dbb-120d-44bc-89eb-803b2caf35fc", + "name" : "phone", + "description" : "OpenID Connect built-in scope: phone", + "protocol" : "openid-connect", + "attributes" : { + "include.in.token.scope" : "true", + "consent.screen.text" : "${phoneScopeConsentText}", + "display.on.consent.screen" : "true" + }, + "protocolMappers" : [ { + "id" : "83dc1340-1f91-47eb-8bb5-d324084687f2", + "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" + } + }, { + "id" : "014dfa26-791d-414b-bfb6-0b08605bf30f", + "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" : "e582a1a0-4ad9-4bbd-b41e-a503b435da3a", + "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" : "f762a161-89f2-47a7-83cb-686362280a14", + "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", + "userinfo.token.claim" : "true" + } + } ] + }, { + "id" : "b288b9a7-e8a8-4b0a-8972-af6083835858", + "name" : "offline_access", + "description" : "OpenID Connect built-in scope: offline_access", + "protocol" : "openid-connect", + "attributes" : { + "consent.screen.text" : "${offlineAccessScopeConsentText}", + "display.on.consent.screen" : "true" + } + } ], + "defaultDefaultClientScopes" : [ "role_list", "saml_organization", "profile", "email", "roles", "web-origins", "acr", "basic" ], + "defaultOptionalClientScopes" : [ "offline_access", "address", "phone", "microprofile-jwt", "organization" ], + "browserSecurityHeaders" : { + "contentSecurityPolicyReportOnly" : "", + "xContentTypeOptions" : "nosniff", + "referrerPolicy" : "no-referrer", + "xRobotsTag" : "none", + "xFrameOptions" : "SAMEORIGIN", + "contentSecurityPolicy" : "frame-src 'self'; frame-ancestors 'self'; object-src 'none';", + "strictTransportSecurity" : "max-age=31536000; includeSubDomains" + }, + "smtpServer" : { }, + "eventsEnabled" : false, + "eventsListeners" : [ "jboss-logging" ], + "enabledEventTypes" : [ ], + "adminEventsEnabled" : false, + "adminEventsDetailsEnabled" : false, + "identityProviders" : [ ], + "identityProviderMappers" : [ ], + "components" : { + "org.keycloak.services.clientregistration.policy.ClientRegistrationPolicy" : [ { + "id" : "c7eaaf0f-7650-4fc1-968a-889667759858", + "name" : "Allowed Client Scopes", + "providerId" : "allowed-client-templates", + "subType" : "anonymous", + "subComponents" : { }, + "config" : { + "allow-default-scopes" : [ "true" ] + } + }, { + "id" : "1f0661c3-25de-4ff6-92bf-dbb36264a71b", + "name" : "Max Clients Limit", + "providerId" : "max-clients", + "subType" : "anonymous", + "subComponents" : { }, + "config" : { + "max-clients" : [ "200" ] + } + }, { + "id" : "a889dafe-f9d0-4728-bdf5-9421d1077d1f", + "name" : "Consent Required", + "providerId" : "consent-required", + "subType" : "anonymous", + "subComponents" : { }, + "config" : { } + }, { + "id" : "4790f0a4-3450-4dbf-9153-0a1805e02d98", + "name" : "Allowed Registration Web Origins", + "providerId" : "registration-web-origins", + "subType" : "authenticated", + "subComponents" : { }, + "config" : { } + }, { + "id" : "4084bb89-71f9-4363-a5dd-dfa74e638d80", + "name" : "Allowed Protocol Mapper Types", + "providerId" : "allowed-protocol-mappers", + "subType" : "anonymous", + "subComponents" : { }, + "config" : { + "allowed-protocol-mapper-types" : [ "saml-user-attribute-mapper", "oidc-sha256-pairwise-sub-mapper", "oidc-address-mapper", "saml-role-list-mapper", "oidc-usermodel-attribute-mapper", "oidc-usermodel-property-mapper", "saml-user-property-mapper", "oidc-full-name-mapper" ] + } + }, { + "id" : "dba96a52-5743-47d2-b5f5-42452892b0bd", + "name" : "Allowed Client Scopes", + "providerId" : "allowed-client-templates", + "subType" : "authenticated", + "subComponents" : { }, + "config" : { + "allow-default-scopes" : [ "true" ] + } + }, { + "id" : "85b9458c-d890-48b8-87b7-7d3d5f331d5f", + "name" : "Allowed Protocol Mapper Types", + "providerId" : "allowed-protocol-mappers", + "subType" : "authenticated", + "subComponents" : { }, + "config" : { + "allowed-protocol-mapper-types" : [ "saml-user-attribute-mapper", "oidc-full-name-mapper", "saml-user-property-mapper", "oidc-usermodel-property-mapper", "oidc-sha256-pairwise-sub-mapper", "saml-role-list-mapper", "oidc-usermodel-attribute-mapper", "oidc-address-mapper" ] + } + }, { + "id" : "181cd220-28a9-4a5e-b2d7-c9092c26ef67", + "name" : "Full Scope Disabled", + "providerId" : "scope", + "subType" : "anonymous", + "subComponents" : { }, + "config" : { } + }, { + "id" : "be0c3922-b432-408c-935b-81923b0e7018", + "name" : "Trusted Hosts", + "providerId" : "trusted-hosts", + "subType" : "anonymous", + "subComponents" : { }, + "config" : { + "host-sending-registration-request-must-match" : [ "true" ], + "client-uris-must-match" : [ "true" ] + } + }, { + "id" : "81fe5bf6-4e18-40b8-8cf6-46028fb6704c", + "name" : "Allowed Registration Web Origins", + "providerId" : "registration-web-origins", + "subType" : "anonymous", + "subComponents" : { }, + "config" : { } + } ], + "org.keycloak.userprofile.UserProfileProvider" : [ { + "id" : "bd8f87c6-ffc2-401d-baab-cccb228e9b50", + "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" : "2068dd28-1706-4fc6-8751-ead7dc26cf90", + "name" : "aes-generated", + "providerId" : "aes-generated", + "subComponents" : { }, + "config" : { + "kid" : [ "81bfaacd-ca1f-4b68-a1b2-80102555f5d6" ], + "secret" : [ "XEHl3aG9cESD4wedDu3uAg" ], + "priority" : [ "100" ] + } + }, { + "id" : "4bc97a67-b5fd-4bd5-9df9-7366efc0e091", + "name" : "hmac-generated-hs512", + "providerId" : "hmac-generated", + "subComponents" : { }, + "config" : { + "kid" : [ "31342681-e4fb-428d-bd54-07a77581ec75" ], + "secret" : [ "UhZlVtujVRkaFsvdVAOGPTEsNIwAJIOfmJDjQeciaQuWIGKWd-RBdKcS0II053kVswbJRGitqc-e0iqBfhZrUBrQyUmmcrCJT09BiaKCicdgRwYrb8fhYagiIg-70jk7fc3j3VINu5eeKjkTiDyfAf_0HS62-8eO4e98A5IW6QE" ], + "priority" : [ "100" ], + "algorithm" : [ "HS512" ] + } + }, { + "id" : "1cf333a1-b495-47b5-94f4-138e34e92ec7", + "name" : "rsa-generated", + "providerId" : "rsa-generated", + "subComponents" : { }, + "config" : { + "privateKey" : [ "MIIEpAIBAAKCAQEAvQ5kJj9mHLGm5zMvW5kYgSbEVvZYWcmMJKMQRWni4RdvbrKpkgsLv6gkH0xiwKU5aaUmk/e6hAZO2UvZ8Tp180VBhk2BXtS21Jm7KbZSVtQBFf33zVqjEXB2d89E1R6RlopzF4+Y6X1xxPnJ1UGxM0yT8uSrGB4CbJaNO4YH6/vUsJWoNXS9MJKFIvm0HP6t+o6DvWGn5HjLK7jhhF6iATZpp0JwqkG5Y+xo6TObx3m11aCR1HrFqlVg6zC3Ht4lhlQh3VhKcoO80gRAURU7WjOOAwauJViYrOF6eAsbMbpTD8EAyXL/4KCFWoITwRpHYNXwSzdR/BvgFlsJwLxJGwIDAQABAoIBABTzpleyyP8/FO8kdgghtFyDzliQ3oO82WIqDCCVNoaZkUjkVfSQctHfsXkifwM4jF9P5TGaz7nX9R8Rz+py/yVhtHxM1JyM2GJBU0OxJ/jlb+VfCvpgJBhHrWljuA4iYCId39lpmZmuxE//GsYejKPRxceyXd/DW6NrH+XL2c7mHe0AznAEfDeIsKWRDCoOjgm2xfpjU204HGLGmU+qTzH4EeZPWvpCnXWZiNBrxSiBUdauCMz6jWBZXW173rfd430t9JMu7zuPqFpcZ/RsLw3blHoPWpbpeULloxfSgxcYD+KP+oCk8t2oubTDGX2ES7OVfSbgy5yMYPbg7g+G97kCgYEA7Jj4d4tdTCOfk5kdqU2R7LB5IX3gsCohmp6FH3yPA2JBQ95Mk6IK15mIvvCXF4zyDvESsevjjQSlEhmYOQ1Us5MdvKZVtM/EgIZmI+3Z+r5M39QWQ8XYkOJr1DT990ed+QVF7H0khT7nmvmVzDYjPE1qtTtzadhwxY8r0Kcmew0CgYEAzI9bpm5rvpf3jfTPZeKb8pc1/4zlUqV0kH+P5BHnssXBX8nVJNgUxcv5xFZrL3MVr5BIYrXSh5qzYduGXkjsjCvo0zdhPmGvRYeL13xJi8EijbK78eORpdx5dN1Oht36+THtWSYnOyFU1gYZEdb3JC0Sc9TwjDPh5RWWLp2MqscCgYEAq85xLy3uc+myaVXYqiZ//qYvb9ieno4ZlNPjy3eBym1BA22boeEbinAdUroWna1l4N/COZ0XwkFLNReM6HD7vuLnxyPqPMBa6xGtfg2sKl6iKC80c8ZpetxQfOp2OWiyGDByFEbTjEafnHP9CSuO7q0w/aXMK2JWkb9ji8K1OMkCgYBmFPB2uMn5/hpi9BV/0btjL4SZ9/UE7l6iMZZcCXdn5noe1DkSvuZ24tjM2xd4QWVEDKui3vumAlScdBG1AY1SUiNJLGzR1avC9eaabYLCRGp67gQOrTMk40aVRE+IzEQPkZPRllGjl3mfqMFf/resjPWVamF0hfun98LPln35RwKBgQCrD+b/1kcSdHRUsaG04vEK8Qpm86E9GV8eLorMJv+gaOAAQXAgxQTp1QXlK/1A11Fj5CYTYg5vQtI16K3KYuF2tdhRR5LRlp0NDK7wf4QNhuK9OQfroHoETngOXGnA2p/RMaDKkAgh49GLT7vMo98ztjsrcRQqNOMGya8L1k48Jg==" ], + "certificate" : [ "MIICmzCCAYMCBgGcnhPYNDANBgkqhkiG9w0BAQsFADARMQ8wDQYDVQQDDAZtYXN0ZXIwHhcNMjYwMjI3MDc0ODQ2WhcNMzYwMjI3MDc1MDI2WjARMQ8wDQYDVQQDDAZtYXN0ZXIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC9DmQmP2YcsabnMy9bmRiBJsRW9lhZyYwkoxBFaeLhF29usqmSCwu/qCQfTGLApTlppSaT97qEBk7ZS9nxOnXzRUGGTYFe1LbUmbsptlJW1AEV/ffNWqMRcHZ3z0TVHpGWinMXj5jpfXHE+cnVQbEzTJPy5KsYHgJslo07hgfr+9Swlag1dL0wkoUi+bQc/q36joO9YafkeMsruOGEXqIBNmmnQnCqQblj7GjpM5vHebXVoJHUesWqVWDrMLce3iWGVCHdWEpyg7zSBEBRFTtaM44DBq4lWJis4Xp4CxsxulMPwQDJcv/goIVaghPBGkdg1fBLN1H8G+AWWwnAvEkbAgMBAAEwDQYJKoZIhvcNAQELBQADggEBABWqPOyc4ReF3EnjSaD3n6Fk0ZVGDJZ6/du2cqlFm9rFEVlnJ0GS7Cz8an88PTge098gxM3+NSCjfgDN3B2QO//H3SdwjmGvKm1hghQVYvfFafW/Cat/nNqm68K6MCGNGP67OeNMLyl3OAL68SRNM1hoNbCplDt6HhX5s1Cn/iZPEQ7t4o6tt/aO/07E+3WfS3+PNqvt7jPrf0y5OlZ7oCAN0cnegSkbanvZehBlRpLkWhxphlAR90PomrW59Ok60EITscXr1jD1vlOgrvnw41y1L5eSvO3g19rKgqB5NrniavRdonP605109SQacZ31g7vmH/2qvV3MUuT9UBoRRFI=" ], + "priority" : [ "100" ] + } + }, { + "id" : "b68cba6a-7e0b-42be-a3aa-25d5c342801a", + "name" : "rsa-enc-generated", + "providerId" : "rsa-enc-generated", + "subComponents" : { }, + "config" : { + "privateKey" : [ "MIIEowIBAAKCAQEApFfSvqZKE30r0gu77DbLv5P6NBiEsCC30KlQp4gbyyHgQuHFWhPyUNJKi0NJGjyFzkw7cztmB7uJOa9oc54QQITdlzLEQ1Z8zvsv6hG5aNDwSLgCNiKHaIAxe6XmCYwhQX3LNGaUidf/a9JS+Kr/WMjQb9Y2NGbKqM5V2vAskq/p7CR2TLVShX2iGlPVO34qYbJSA6nF98n0x2ZxAdj8P77HqWJs0z/wRGxEFPmoWP4QR+b9q9f2ewr7EmIXOi7ZsxNF4g0CCo4zqUD4VGnGABl158zx+9ONedgBTnZNwnb9iM++bFt5exuvjbQ86jpnPrMR1yhIVKGSAddUlbV9IwIDAQABAoIBAE569BSAM7K/3SvG17yTZFQ99cdoCAFV9oHKQU5nxKIKMN6vkz+Tc+2dpuR/QsspKNrd86vxKyW5LGxkNBS2YFt3N5yrLSddB2gOcxCr2ydPU9feK4wvjAte4IKENGjNxtnQGTiSXg+/muWiAGZovlznNQabPLJkfhYDxuMxO4/mdcNSX3riJ/u6MtUS2BZMxOZWvZZ+t1boakJsn7LUycXngpMlZBrivZ9+bckD75iEAsTlwAzj2Tm1VgycmtwcOwvNAL/Eb35yqemBggYNqjxpdi+3Mm2OgHdWmWIdXpHbuYcw/FaKUKIFJ9JiBZYeDYK2Adb8pHQh050assU6m+ECgYEA5Xe0M6a/yL+j+0lpM9xrz4R21c67uy9Tg70l8/8N1rtam+M7hqtHYMwvtWZ1pSFSoxZ+6iVlI2xg5BqSX1tkV5QNtHcOlrrgysBWPXzz6oyrG+j2pAJ2bvNd+haCu2WOANPbs03bIc4/PUiPevXGKBf0ZuJ22P78GCp+/VZt4YMCgYEAt1hq2ufPSlbYJ3uItmBBPoIHvHDm4MELqjCSPqTo4BKrPdmlDv7p3pAG8+D/8K2jZEDRMyOatEnUH64RqQBuCs9YgcrRqkrzxhnqLGKllH+Z3QOwT+xCntkAnxI8fULeAbOJvw8Nb1dAtTODY+wrvmUEhvbyYQ76guzqtSTfQ+ECgYEA09acf4qTRurUoel1u7DjvqIVavD9kqLwQJBf908hIXm4/mzayUpaDNyzto2uUhHfTjw4UkTPh9JH6I03T9z5V3iQ5md7Cl/foo3Jj95I9+GBHbUF7Qdw+qClw3kAm6v3WoA7NN7NS/oxm4vfGa7Hjr/+mvS6rz1G0bB5p7sgma0CgYAtXwoCZf8cLGWNT7rDNwquR0tWzLG1yM/0K9Tk/7ZJTRVnVubL0TVayFWQIIv1qWKXupqKhzMPjn2Z4V+pbNvOfQUwCVrdQ3MUAPG8TiUfnHwc/36wKI1L9fN7ae3iKZv6280opLb0aKkwrjDDl3wzv5fhNldAwY4ovCxQ63D8wQKBgE6ZR/2bPYAa0O5pA7lPGSKfKYZY4U4zNwhgTAgzm2b7ONyJSP00yVwXoBX4j8qHbotVQY+8VMfFo49t3JCJ61g/Q/T3Uyd43fz1LzoQKFInDe1B7yXfPkEL4R7rllVmEvhoszgivYtevIoE//ZeHiMAn53nBJFgGuQyk7BMx7z0" ], + "certificate" : [ "MIICmzCCAYMCBgGcnhPYrjANBgkqhkiG9w0BAQsFADARMQ8wDQYDVQQDDAZtYXN0ZXIwHhcNMjYwMjI3MDc0ODQ2WhcNMzYwMjI3MDc1MDI2WjARMQ8wDQYDVQQDDAZtYXN0ZXIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCkV9K+pkoTfSvSC7vsNsu/k/o0GISwILfQqVCniBvLIeBC4cVaE/JQ0kqLQ0kaPIXOTDtzO2YHu4k5r2hznhBAhN2XMsRDVnzO+y/qEblo0PBIuAI2IodogDF7peYJjCFBfcs0ZpSJ1/9r0lL4qv9YyNBv1jY0ZsqozlXa8CySr+nsJHZMtVKFfaIaU9U7fiphslIDqcX3yfTHZnEB2Pw/vsepYmzTP/BEbEQU+ahY/hBH5v2r1/Z7CvsSYhc6LtmzE0XiDQIKjjOpQPhUacYAGXXnzPH704152AFOdk3Cdv2Iz75sW3l7G6+NtDzqOmc+sxHXKEhUoZIB11SVtX0jAgMBAAEwDQYJKoZIhvcNAQELBQADggEBAKNZLkRF4xSD7KltDoHn3ND+ouDaK5AQH4uZtbp5Rl+3beqwOpnPEJmCzhuhvij6eVngviL0Ga8pFIBzX7zQu2v8oxTFIbGvAYBH9NNkA8R/qsaosC4C/mEmY/H9UDGUXp1VSFI8e08n2GlnVoll9t1wCvhyaMqpFqglmD8SccGTKiBKeSD4v+SWN19+Wi4KOvI5wqR0KKrvlmNWDxbsYzsUbU/gII7Y5nsUB3L2RvugXssX8+zgTYuyBoygEgdXcOKsyWRQ/vmGr9ZE+8RuBsWTS0at8m3SN/nCkarboVFLhnqbRVpV5uLrx4LVRkGNmVCXKccf3Poh+DbxgLD/kNU=" ], + "priority" : [ "100" ], + "algorithm" : [ "RSA-OAEP" ] + } + } ] + }, + "internationalizationEnabled" : false, + "authenticationFlows" : [ { + "id" : "f1ec49bd-55dd-4584-9438-bedf328b356d", + "alias" : "Account verification options", + "description" : "Method with which to verify 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" : "72f9d538-d665-468f-8c06-cc6ef863d699", + "alias" : "Browser - Conditional 2FA", + "description" : "Flow to determine if any 2FA 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 + }, { + "authenticatorConfig" : "browser-conditional-credential", + "authenticator" : "conditional-credential", + "authenticatorFlow" : false, + "requirement" : "REQUIRED", + "priority" : 20, + "autheticatorFlow" : false, + "userSetupAllowed" : false + }, { + "authenticator" : "auth-otp-form", + "authenticatorFlow" : false, + "requirement" : "ALTERNATIVE", + "priority" : 30, + "autheticatorFlow" : false, + "userSetupAllowed" : false + }, { + "authenticator" : "webauthn-authenticator", + "authenticatorFlow" : false, + "requirement" : "DISABLED", + "priority" : 40, + "autheticatorFlow" : false, + "userSetupAllowed" : false + }, { + "authenticator" : "auth-recovery-authn-code-form", + "authenticatorFlow" : false, + "requirement" : "DISABLED", + "priority" : 50, + "autheticatorFlow" : false, + "userSetupAllowed" : false + } ] + }, { + "id" : "b7e3c8f7-17bf-4a76-8921-2afb316272dd", + "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" : "8bb954d6-800e-4ff4-bea8-d5fe51a101e6", + "alias" : "First broker login - Conditional 2FA", + "description" : "Flow to determine if any 2FA 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 + }, { + "authenticatorConfig" : "first-broker-login-conditional-credential", + "authenticator" : "conditional-credential", + "authenticatorFlow" : false, + "requirement" : "REQUIRED", + "priority" : 20, + "autheticatorFlow" : false, + "userSetupAllowed" : false + }, { + "authenticator" : "auth-otp-form", + "authenticatorFlow" : false, + "requirement" : "ALTERNATIVE", + "priority" : 30, + "autheticatorFlow" : false, + "userSetupAllowed" : false + }, { + "authenticator" : "webauthn-authenticator", + "authenticatorFlow" : false, + "requirement" : "DISABLED", + "priority" : 40, + "autheticatorFlow" : false, + "userSetupAllowed" : false + }, { + "authenticator" : "auth-recovery-authn-code-form", + "authenticatorFlow" : false, + "requirement" : "DISABLED", + "priority" : 50, + "autheticatorFlow" : false, + "userSetupAllowed" : false + } ] + }, { + "id" : "9459afd7-9f72-4702-9f60-989664925fd3", + "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" : "f78ffd37-a52e-4c1a-b524-e7e30e8b59b0", + "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" : "221d25d8-15e0-44f0-ab87-890091819de2", + "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" : "3abe4382-9087-4654-9f6a-13a882af038c", + "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 2FA", + "userSetupAllowed" : false + } ] + }, { + "id" : "bb681a9f-3bfa-4fa8-a8b6-74463a6cf493", + "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" : "f02d0da2-4f63-4ec1-ad1e-1bf5b9388e44", + "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" : "0326d889-4cc3-43fd-94eb-fc05ae1277eb", + "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" : "5cf04370-c12d-484f-befb-47fec450afc7", + "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" : "e9abe54d-edc6-4c80-b72a-e6603fb03a02", + "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" : "39318842-fb7e-4356-a97e-69db12d00280", + "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 2FA", + "userSetupAllowed" : false + } ] + }, { + "id" : "725e0d82-e0b9-428b-88ed-d11ddab6159a", + "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" : "ba6f9d02-2a96-4220-9cbf-d3f64718923d", + "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" : "3a53ff54-b0cb-465f-86c8-e243d4ec0004", + "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" : "b977c3de-2d43-4759-ba01-3fc5af17b0dd", + "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" : "c10561b1-ae3f-4cb4-9608-72fb3d83a98a", + "alias" : "browser-conditional-credential", + "config" : { + "credentials" : "webauthn-passwordless" + } + }, { + "id" : "d22338ae-5ecc-4b20-b781-fbcd610ffcb6", + "alias" : "create unique user config", + "config" : { + "require.password.update.after.registration" : "false" + } + }, { + "id" : "4338fbaa-8922-4274-9b3b-f6c9c00002a3", + "alias" : "first-broker-login-conditional-credential", + "config" : { + "credentials" : "webauthn-passwordless" + } + }, { + "id" : "48dfd05d-b3be-4d5d-a704-e1a1ac93b8eb", + "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" : "UPDATE_EMAIL", + "name" : "Update Email", + "providerId" : "UPDATE_EMAIL", + "enabled" : false, + "defaultAction" : false, + "priority" : 70, + "config" : { } + }, { + "alias" : "webauthn-register", + "name" : "Webauthn Register", + "providerId" : "webauthn-register", + "enabled" : true, + "defaultAction" : false, + "priority" : 80, + "config" : { } + }, { + "alias" : "webauthn-register-passwordless", + "name" : "Webauthn Register Passwordless", + "providerId" : "webauthn-register-passwordless", + "enabled" : true, + "defaultAction" : false, + "priority" : 90, + "config" : { } + }, { + "alias" : "VERIFY_PROFILE", + "name" : "Verify Profile", + "providerId" : "VERIFY_PROFILE", + "enabled" : true, + "defaultAction" : false, + "priority" : 100, + "config" : { } + }, { + "alias" : "delete_credential", + "name" : "Delete Credential", + "providerId" : "delete_credential", + "enabled" : true, + "defaultAction" : false, + "priority" : 110, + "config" : { } + }, { + "alias" : "idp_link", + "name" : "Linking Identity Provider", + "providerId" : "idp_link", + "enabled" : true, + "defaultAction" : false, + "priority" : 120, + "config" : { } + }, { + "alias" : "CONFIGURE_RECOVERY_AUTHN_CODES", + "name" : "Recovery Authentication Codes", + "providerId" : "CONFIGURE_RECOVERY_AUTHN_CODES", + "enabled" : true, + "defaultAction" : false, + "priority" : 130, + "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", + "clientOfflineSessionMaxLifespan" : "0", + "oauth2DevicePollingInterval" : "5", + "clientSessionIdleTimeout" : "0", + "clientOfflineSessionIdleTimeout" : "0", + "cibaInterval" : "5", + "realmReusableOtpCode" : "false", + "cibaExpiresIn" : "120", + "oauth2DeviceCodeLifespan" : "600", + "saml.signature.algorithm" : "", + "parRequestUriLifespan" : "60", + "clientSessionMaxLifespan" : "0", + "frontendUrl" : "", + "acr.loa.map" : "{}" + }, + "keycloakVersion" : "26.5.4", + "userManagedAccessAllowed" : false, + "organizationsEnabled" : false, + "verifiableCredentialsEnabled" : false, + "adminPermissionsEnabled" : false, + "clientProfiles" : { + "profiles" : [ ] + }, + "clientPolicies" : { + "policies" : [ ] + } +} \ No newline at end of file diff --git a/seeds/pocket-id/.gitkeep b/seeds/pocket-id/.gitkeep new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/seeds/pocket-id/.gitkeep @@ -0,0 +1 @@ + diff --git a/seeds/pocket-id/portabase.zip b/seeds/pocket-id/portabase.zip new file mode 100755 index 00000000..66744064 Binary files /dev/null and b/seeds/pocket-id/portabase.zip differ diff --git a/src/env.mjs b/src/env.mjs index 65bf7e82..fe6361e6 100644 --- a/src/env.mjs +++ b/src/env.mjs @@ -130,6 +130,8 @@ export const env = createEnv({ AUTH_SYNC_OIDC_ROLES_ON_LOGIN: process.env.AUTH_SYNC_OIDC_ROLES_ON_LOGIN, + AUTH_ROLE_MAP: process.env.AUTH_ROLE_MAP, + AUTH_ALLOW_LINKING: process.env.AUTH_ALLOW_LINKING, AUTH_ALLOW_UNLINKING: process.env.AUTH_ALLOW_UNLINKING, diff --git a/src/lib/auth/auth.ts b/src/lib/auth/auth.ts index 0e5759f2..eeb9f35f 100644 --- a/src/lib/auth/auth.ts +++ b/src/lib/auth/auth.ts @@ -187,16 +187,33 @@ export const auth = betterAuth({ const roleMapStr = oidcProvider?.roleMap; const rawGroups = userInfo?.groups || userInfo?.roles || []; + const userGroups: string[] = Array.isArray(rawGroups) - ? rawGroups - : [rawGroups]; + ? rawGroups.reduce((carry: string[], group) => { + carry.push(String(group).toLowerCase()); + return carry; + }, []) + : [String(rawGroups).toLowerCase()]; let roleToAssign: string | undefined; if (roleMapStr) { const mappings = roleMapStr.split(",").map((m) => m.split(":")); for (const [group, role] of mappings) { + console.log( + "Checking role mapping:", + group.trim(), + "against user groups:", + userGroups, + ); + if (userGroups.includes(group.trim())) { + console.log( + "Role mapping matched for group:", + group.trim(), + "->", + role.trim(), + ); roleToAssign = role.trim(); break; }