On the registration page, it requires first and last name but I have deleted the html tag from the page and the it shows the following error messages after the sign up was pressed:
The question is, how to make the fields first and last name not as mandatory.
You could also take another approach by disabling the profile validation in the flows. But this also disables the email check, so, yes âŚ
Iâve read somewhere that you can implement your own validation checks but to be honest I couldnât be bothered.
It shouldnât be this hard just to disable some fields on a registration page.
BTW If you want to create a custom form action than take a look at org.keycloak.authentication.forms.RegistrationProfile which is the Profile validation of those 3 fields.
You can copy it and adapt it to the things you want. Just make sure that the PROVIDER_ID is not longer than 36 chars.
You can than copy the registration flow and add it as an execution step and delete the original one.
This is something I wanted to do between other things but didnât have time yet to fully implement and test it.
Iâve bookmarked this page and will keep you updated of the progress. I donât know when Iâll have the time though as this is not my main priority at the moment.
I do not have any experience with JBOSS. What is a standalone-ha.xml file? Is it not enough to compile it and put the jar file into the folder /opt/jboss/keycloak/standalone/deployments/?
It will be enough if you have implemented an alternative for those validate methods and also Message ones because they use parts of the services module from Keycloak.
I canât guarantee that it will work without changing the standalone-ha.xml file as I used that method
The standalone-ha.xml file can be found under /opt/jboss/keycloak/standalone/configuration/
Sooner or later you will probably touch this file so itâs good to get to know it.
Also look which your deployment uses, because the Docker image uses the -ha.xml high availability one. It could be that yourâs uses the standalone.xml one but I doubt it.
Hi @zonaut thanks for your answer.
I am running Keycloak in docker container.
I will do as you suggested and will let you know, if it is working or not.
Another question, how do you know, which dependencies to import in maven file:
The dependencies Iâve imported are not all necessary for this project. Iâve removed some parts of it and created a new repo as it contained some confidential thingies of mine
You probably can remove the freemarker, jboss-jaxrs-api_2.1_spec, jboss-logging and keycloak-saml-core-public easily. Remove until breakage.
BTW, I always have my own standalone-ha.xml file outside my Docker container and mount it.
No problem at all.
Another thing about the dependencies, the scope âprovidedâ tells it to look for the dependencies in the container, in this case Keycloak itself. So these are not compiled into the jar as you can see by the size of it. So donât worry if youâve forgot one.
I think, that the extension was successfully loaded:
14:46:22,872 INFO [org.keycloak.services] (ServerService Thread Pool -- 70) KC-SERVICES0001: Loading config from standalone.xml or domain.xml
14:46:22,919 INFO [org.keycloak.url.DefaultHostnameProviderFactory] (ServerService Thread Pool -- 70) Frontend: <request>, Admin: <frontend>, Backend: <request>
14:46:23,487 INFO [org.keycloak.url.DefaultHostnameProviderFactory] (ServerService Thread Pool -- 70) Frontend: <request>, Admin: <frontend>, Backend: <request>
14:46:23,512 WARN [org.keycloak.services] (ServerService Thread Pool -- 70) KC-SERVICES0047: ph-registration-profile-action (com.placeholder.keycloak.extensions.actions.forms.PlaceholderRegistrationProfile) is implementing the internal SPI form-action. This SPI is internal and may change without notice
14:46:23,560 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 70) WFLYCLINF0002: Started realmRevisions cache from keycloak container
14:46:23,570 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 70) WFLYCLINF0002: Started userRevisions cache from keycloak container
14:46:23,590 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 70) WFLYCLINF0002: Started authorizationRevisions cache from keycloak container
14:46:23,591 INFO [org.keycloak.connections.infinispan.DefaultInfinispanConnectionProviderFactory] (ServerService Thread Pool -- 70) Node name: 1726f233343b, Site name: null
Youâve clicked the wrong Execution.
â Click the Actions dropdown menu to the far right of âCopy Of Registration Registration Formâ and select âAdd executionâ
You need to click the blue actions dropdown farthest right
Iâve found things out by crawling through the source code of Keycloak itself. It contains a bunch of examples on these providers and other little handy thingies. Github is a dream come true
But at the end of the day itâs still trial and error so we can only learn from each other and pass that information on.