Uploaded image for project: 'Keycloak'
  1. Keycloak
  2. KEYCLOAK-7523

PathBasedKeycloakConfigResolver uses wrong context path

    Details

    • Type: Enhancement
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 4.0.0.Beta3
    • Fix Version/s: 4.0.0.Final
    • Component/s: None
    • Labels:
      None
    • Docs QE Status:
      NEW
    • QE Status:
      NEW

      Description

      org.keycloak.adapters.osgi.PathBasedKeycloakConfigResolver currently splits full request URI by / and simply takes 4th element. E.g.,: http://localhost/a/b/c/da.

      However we can have requests targeted at different servlet contexts, and sometimes (in OSGi it's not that uncommon) we use default context with empty context path. For example CXF registers its /cxf servlet in default context.

      However, having single configuration (resolved by PathBasedKeycloakConfigResolver) for each servlet registered in default context is maybe not a good idea...

      My idea is:

      • if the context name is non empty, use it (and <context>-keycloak.json)
      • if the context name is empty, use the first path segment (like in http://localhost/cxf path, where /cxf servlet was registered in default context) - that in theory doesn't differ from what we have now, but it should be documented.
      • in theory, there can be a/b context path, resulting configuration file should be a-b-keycloak.json

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  grgrzybek Grzegorz Grzybek
                  Reporter:
                  grgrzybek Grzegorz Grzybek
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: