After migration from keycloak 16 wildfly to keycloak 17 quarkus we see an issue that registrations fails on mediatype is null in BaseHttpRequest…
Is this caused by missing configuration somewhere ?
update, after lots of debugging the issue is that it uses the implementation “VertxHttpRequest” in stead of HttpServletInputMessage…
And in VertxHttpRequest there is no method getDecodedFormParameters which is used by keycloaks RegistrationUserCreation…
So therefore it uses the abstract class and gives a nullpointer …
Strange, can not find any documentation why its doing this on keycloak quarkus
hey,
the change in keycloak x, seems like the wrong http request impl is used (vertx in stead of resteasy) with the rgistreation/create account link (a href) on the login page.
trying workarround not using the getdecodedparam method as used in the keycloaks createuser java code, so overriding it.
Did you create an issue or at least started a discussion in the Keycloak GitHub repository?
If no, please do it to clarify/verify behavior.
If yes, please post the link to the issue/discussion here.
Thanks.
Thanks, i now created an issue:
opened 09:12AM - 10 Mar 22 UTC
closed 08:31PM - 14 Jun 22 UTC
kind/bug
area/dist/quarkus
We migrated to keycloak quarkus, which introduced a bug/nullpointer in our build… Page method of our custom RegistrationUserCreation.
Normally you can use getDecodedFormParameters in all FormAction Implementations.
In the keycloak default RegistrationUserCreation, this method is also used in validate , but the buildPage is empty method implementation. We override this FormAction and have custom code that uses the getDecodedFormParameters.
In keycloak wildfly the implementation class HttpServletInputMessage handles this and that doesn't check for mediatype.
But now in keycloak quarkus, because the registration is done via a anchor link (like is also the default in keycloak), the VertHttpRequest handles this request , which doesn't have a getDecodedFormParameters implementation. Therefore it uses its abstract super class BaseHttpRequest. In here the mediaType is used but the mediaType is null, and causes a nullpointer exception.
### Version
17.0.0 (quarkus)
### Expected behavior
Avoid nullpointer exception OR handle request in HttpServletInputMessage in stead of VertxHttpRequest.
This because VertHttpRequest does not implement a getDecodedFormParameters method and therefore fallsback to the abstract class BaseHttpRequest getDecodedFormParameters.
### Actual behavior
MediaType null causes Nullpoiner exception in BaseHttpRequest - getFormParameters.
### How to Reproduce?
Make a custom implementation of the RegistrationUserCreation, and in the buildPage, add the following line:
context.getHttpRequest().getDecodedFormParameters()
This will cause a nullpointerexception within the getDecodedFormParameters()
### Anything else?
no
1 Like
ok, that our custom adjustment will do in checking if its a form submit or ahref action.
thanks