Skip to content

A realm that does not exist in Keycloak causes an IllegalArgumentException exception #291

Description

@rusiaikinat

Environment

Version: 2026.1.999-SNAPSHOT

Bug Description

When testing a BPM engine connection with authentication type OAuth 2 (Client/Secret), if the realm specified in Issuer URI does not exist (or is unreachable for OIDC discovery), the application shows the user the raw text of an unhandled IllegalArgumentException instead of the standard localized error notification (oauth2AutorizationFailure.*).

Steps To Reproduce

  1. Administration → BPM engines → Create (or edit an existing engine).
  2. Authentication → Enabled → Type = OAuth 2 (Client/Secret).
  3. Set Issuer URI to a nonexistent realm, e.g. http://localhost:8180/realms/sample3 (realm sample3 does not exist in Keycloak).
  4. Fill in any values for Client ID / Client secret.
  5. Click Test connection.

Current Behavior

Image
IllegalArgumentException: Unable to resolve Configuration with the provided Issuer of "http://localhost:8180/realms/sample3", errors: [404 Not Found on GET request for "http://localhost:8180/realms/sample3/.well-known/openid-configuration": "{"error":"Realm does not exist"}", 404 Not Found on GET request for "http://localhost:8180/.well-known/openid-configuration/realms/sample3": "{"error":"HTTP 404 Not Found"}", 404 Not Found on GET request for "http://localhost:8180/.well-known/oauth-authorization-server/realms/sample3": "{"error":"Realm does not exist"}"]

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    triageIssue is waiting for triage

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions