aerogear / keycloak-metrics-spi

Adds a Metrics Endpoint to Keycloak
Apache License 2.0
523 stars 151 forks source link

Strange StringIndexOutOfBoundsException if using KC_HTTP_RELATIVE_PATH=/auth #190

Closed ghenadiibatalski closed 3 weeks ago

ghenadiibatalski commented 5 months ago

Description

I'm facing an StringIndexOutOfBoundsException in ResourceExtractor .

The problem occurs only in case of KC_HTTP_RELATIVE_PATH and only if the path was entered without the trailing /.

Expected Behavior

Should work as excpected also if KC_HTTP_RELATIVE_PATH is configured.

Actual Behavior

Eg: localhost/auth causes the exception while localhost/auth/ looks good. Internally redirects keycloak from /auth to /auth/ but with the MetricsFilter enabled it ends up in an exception.

We could redirect /auth$ to /auth/ on a reverse proxy, but it would be a strange workaround.

Without KC_HTTP_RELATIVE_PATH the filter works as expected (at least there is no exception).

Environment

Latest Keycloak: 23.0.5 keycloak-metrics-spi: 5.0.0

Configured via docker-compose

Steps to reproduce

  1. Start the keycloak with KC_HTTP_RELATIVE_PATH=/auth and keycloak-metrics-spi enabled
  2. Navigate to localhost:8080/auth - an error should occur
ghenadiibatalski commented 5 months ago

The error occurs within the class ResteasyReactiveRequestContext here

mfisch04 commented 4 months ago

This is broken for me as well. I rolled back to the 18.3.2 bitnami helm chart.

ZazaKumar commented 3 months ago

is it fixed in combination of 24.0.1 and metrics-spi-5.0.0?