{"id":20786119,"url":"https://github.com/thomassuedbroecker/keycloak-create-realm-bash","last_synced_at":"2025-04-09T17:38:31.272Z","repository":{"id":127030600,"uuid":"577293072","full_name":"thomassuedbroecker/keycloak-create-realm-bash","owner":"thomassuedbroecker","description":"Simple example to create a realm in Keycloak using bash scripting for local development.","archived":false,"fork":false,"pushed_at":"2023-03-02T08:01:33.000Z","size":570,"stargazers_count":15,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-23T19:44:32.765Z","etag":null,"topics":["bash","curl","keycloak","realm"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thomassuedbroecker.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-12-12T12:21:15.000Z","updated_at":"2025-03-14T23:02:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"fe4db771-b617-4dae-a06a-c44962d9def9","html_url":"https://github.com/thomassuedbroecker/keycloak-create-realm-bash","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomassuedbroecker%2Fkeycloak-create-realm-bash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomassuedbroecker%2Fkeycloak-create-realm-bash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomassuedbroecker%2Fkeycloak-create-realm-bash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomassuedbroecker%2Fkeycloak-create-realm-bash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thomassuedbroecker","download_url":"https://codeload.github.com/thomassuedbroecker/keycloak-create-realm-bash/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248078330,"owners_count":21044090,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash","curl","keycloak","realm"],"created_at":"2024-11-17T14:50:48.525Z","updated_at":"2025-04-09T17:38:31.222Z","avatar_url":"https://github.com/thomassuedbroecker.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Create a realm in Keycloak 20.0.1 using bash scripting\n\nSimple example to create a realm in Keycloak using bash scripting for local development.\n\n1. Start Keycloak in a local container in the development mode.\n2. Use `cURL` to authenticate to get a [`JWT`](https://jwt.io/) to access the master realm to create the new example-realm.\n![](images/keycloak-realm-bash-01.png)\n3. Use the `cURL` with the given `JWT` `access-token` to create the `example-realm`.\n![](images/keycloak-realm-bash-02.png)\n\n### Step 1: Clone the project\n\n```sh\ngit clone https://github.com/thomassuedbroecker/keycloak-create-realm-bash.git\ncd keycloak-create-realm-bash/scripts\n```\n\n### Step 2: Start Keycloak locally in the development mode\n\n```sh\nsh ./local-start-keycloak.sh\n```\n\n* Example output:\n\n```sh\nUpdating the configuration and installing your custom providers, if any. Please wait.\n2022-12-12 19:30:35,726 INFO  [io.quarkus.deployment.QuarkusAugmentor] (main) Quarkus augmentation completed in 5105ms\n...\n2022-12-12 19:30:43,666 INFO  [org.keycloak.services] (main) KC-SERVICES0009: Added user 'admin' to realm 'master'\n2022-12-12 19:30:43,670 WARN  [org.keycloak.quarkus.runtime.KeycloakMain] (main) Running the server in development mode. DO NOT use this configuration in production.\n```\n\n### Step 3: Open a new terminal with the same folder\n\n```sh\npwd\n```\n\n* Example output:\n\n```sh\n/Users/..../keycloak-create-realm-bash/scripts\n```\n\n### Step 4: Create the new realm\n\n```sh\nsh ./local-configure-keycloak.sh\n```\n\n* Example output:\n\n```sh\n************************************\n Configure Keycloak realm\n************************************\n  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current\n                                 Dload  Upload   Total   Spent    Left  Speed\n100  1887  100  1818  100    69   3393    128 --:--:-- --:--:-- --:--:--  3580\nAccess token : eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICIyTXNJRzdtWmhCRWFoaWc2X2ItclNxLVBoRnlkczNjUF8yd3U5OHBrSDE0In0.eyJleHAiOjE2NzA4NDk5NTgsImlhdCI6MTY3MDg0OTg5OCwianRpIjoiN2E4NTYxZmEtN2NhZi00NjE5LWEyMDEtMzFiNTEwMTA4OGY3IiwiaXNzIjoiaHR0cDovL2xvY2FsaG9zdDo4MDgwL3JlYWxtcy9tYXN0ZXIiLCJzdWIiOiJlMjQ5ZjBkNC01Njk0LTRiZTAtOTI4MS0xOWIwMTVkNzFlMGUiLCJ0eXAiOiJCZWFyZXIiLCJhenAiOiJhZG1pbi1jbGkiLCJzZXNzaW9uX3N0YXRlIjoiZDIxYzU3M2ItZGQyMS00MWZmLTlkZWEtM2I4ZDRkZTAzNzc5IiwiYWNyIjoiMSIsInNjb3BlIjoicHJvZmlsZSBlbWFpbCIsInNpZCI6ImQyMWM1NzNiLWRkMjEtNDFmZi05ZGVhLTNiOGQ0ZGUwMzc3OSIsImVtYWlsX3ZlcmlmaWVkIjpmYWxzZSwicHJlZmVycmVkX3VzZXJuYW1lIjoiYWRtaW4ifQ.ZwWiv0Q-VWpwKzOjg_7YbkIAL_29AfNbGoqJoNKA8eCwpnplFKwv6HYlp3VfsFPVvO4hjekfxq8vXrx6QugBkE5fo7PJ06zDHFbtNzOmWR7RpX9Q4uOjRAHq2Gnvs3sHqEWUX0O4dkm5TRW81Cu7GTfiHgZkRtsVMk1OjV7ZtSJ7Ke4dK5C-IIvdNjN_NYxYq7fkWj2_hVqeHRLp31OXu8p8DgQeEKQo940kSu8yCMHQG-QjISiasu9onS94GkOep8DWIGpLQvzndBDMvmr-zHX_519CPldXpkbrwh3nUVM3JGaXdcn3CMloNFgZjgTujWgpThZKiUOah53vxI7qoA\n------------------------------------------------------------------------\nCreate the realm in Keycloak\n------------------------------------------------------------------------\n\n  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current\n                                 Dload  Upload   Total   Spent    Left  Speed\n100 70726    0     0  100 70726      0  64574  0:00:01  0:00:01 --:--:-- 65065\n------------------------------------------------------------------------\nThe realm is created. \nOpen following link in your browser:\nhttp://localhost:8080/admin/master/console/#/example-realm\n------------------------------------------------------------------------\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthomassuedbroecker%2Fkeycloak-create-realm-bash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthomassuedbroecker%2Fkeycloak-create-realm-bash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthomassuedbroecker%2Fkeycloak-create-realm-bash/lists"}