Sign up without first and last name

Hi all

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:

Screenshot from 2020-03-22 17-05-47

The question is, how to make the fields first and last name not as mandatory.


As far as I know you can’t disable them.
I solved this by setting a default value in the html of the theme on those input values.


@zonaut thanks for your response. Seriously? That is not good.
@keycloak_team Please confirm, if it is correct.


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 :stuck_out_tongue: but didn’t have time yet to fully implement and test it.

1 Like

Once you’ve finished it, could you please publish the example? Would would be awesome.

Thanks a lot

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.

Awesome. Thanks a lot.

Ok, now that’s in my mind I couldn’t let it stay there unfinished :stuck_out_tongue:

I’ve made a repo and over time it will contain other examples on events and mail. You can find the repo on

Have fun and if you have any problems let me know or if the readme isn’t clear on some things.


Thanks so much. I will try out, you are the best man… :+1: :+1: :+1: :+1:
I will give you my feedback.

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:

<project xmlns="" xmlns:xsi=""

        <version>9.0.2</version> <!-- -->

    <name>Placeholder Keycloak extensions</name>



I have experienced with sbt and a bit with maven.

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 :stuck_out_tongue:

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.



@zonaut thanks so much for your help. I am appreciate a lot.

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.

one more question:

What do I have to use here?

The docker-compose:

    image: "jboss/keycloak"
    container_name: "keycloak"
    restart: always
      - traefik
      - dataxu
      - "traefik.enable=true"
      - "traefik.http.routers.keycloak.rule=Host(``)"
      - "traefik.http.routers.keycloak.tls=true"
      #- "traefik.http.routers.keycloak.entrypoints=websecure"
      - "traefik.http.routers.keycloak.tls.certresolver=sslresolver"
      - ""
      - ./keycloak/placeholder-keycloak-extensions.jar:/opt/jboss/keycloak/standalone/deployments/placeholder-keycloak-extensions.jar
      - ./keycloak/standalone-ha.xml:/opt/jboss/keycloak/standalone/configuration/standalone-ha.xm

I think, that the extension was successfully loaded:

14:46:22,872 INFO  [] (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  [] (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  [] (ServerService Thread Pool -- 70) WFLYCLINF0002: Started realmRevisions cache from keycloak container
14:46:23,570 INFO  [] (ServerService Thread Pool -- 70) WFLYCLINF0002: Started userRevisions cache from keycloak container
14:46:23,590 INFO  [] (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

You gave me an idea to add pictures to the readme as this is something I’ve stumbled upon myself in the past.

@zonaut great it works like a charm:
Screenshot from 2020-04-03 20-50-00

Thanks so much for your help.
One more question, where do you get the implementation. How do you find it out?


No problem.

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 :stuck_out_tongue:
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.

1 Like

Hello zonaut.
On readme, you read:
“Copy the jar in the target folder to the /opt/jboss/keycloak/standalone/deployments/ folder”

Sorry, but where is the .jar ? I haven’t found the jar in the repo.

Tks in advance.