Skip to content

Upgrading to the KeyCloak 26.x version #21

Description

@peter279k

Description

  • As title, the KeyCloak 23.x version is outdated and it should upgrade to the latest version.
  • Upgrading KeyCloak version steps are as follows:
  1. Modifiying the docker-compose-http.yml file. The reference is as follows:
services:
  keycloak:
    image: quay.io/keycloak/keycloak:26.3.2 # Use the desired Keycloak 26 version
    container_name: keycloak
    ports:
      - "8080:8080" # Map Keycloak's default port
    environment:
      KC_DB: postgres
      KC_DB_URL_HOST: postgres_db
      KC_DB_URL_DATABASE: keycloak
      KC_DB_USERNAME: keycloak
      KC_DB_PASSWORD: password
      KC_HOSTNAME: nifi.peterli.website # Adjust as needed for your environment
      KC_HOSTNAME_STRICT: "false" # Set to "true" for production with proper hostname
      KC_PROXY_HEADERS: "xforwarded" # Important if behind a reverse proxy
      KC_HTTP_ENABLED: "false" # Enable HTTP for development, use HTTPS in production
      KC_BOOTSTRAP_ADMIN_USERNAME: admin
      KC_BOOTSTRAP_ADMIN_PASSWORD: admin
    command: start-dev # Use 'start' for production
    volumes:
      - ./keycloak_data:/opt/keycloak/data
    depends_on:
      - postgres_db
    networks:
      - keycloak-net

  postgres_db:
    image: postgres:16 # Use a compatible PostgreSQL version
    container_name: postgres_db
    environment:
      POSTGRES_DB: keycloak
      POSTGRES_USER: keycloak
      POSTGRES_PASSWORD: password
    volumes:
      - ./postgres_data:/var/lib/postgresql/data
    networks:
      - keycloak-net

networks:
  keycloak-net:
    driver: bridge
  1. Modifying the https://github.com/peter279k/fmsa/blob/master/api_gateway/app/modules.py#L28 file and change the logic of KeyCloakAdmin class.
  2. Supporting the password and client_credentials grant types
  3. Adding or modifying the admin_login method.
  4. Adding or modifying the create_realm method.
  5. Adding or modifying the create_client method.
  6. Adding or modifying the create_user method.
  7. Don't forget adding some unit tests for this issue.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions