Redirect to registration on login with wrong username

Is it possible to redirect the users to registration page, while they try to login, if their username/email does not exist on Keycloak?

I tried to check the error message, but the message is Invalid username or password, so I don’t know if the wrong field is the username or password.

Just my opinion but you shouldn’t do this. You are just giving people a possible attack vector. Sometimes an obscure message is just the way you want to go.

But, if you really want to do this you could for example create your own API endpoint and check it there while they are typing or implement your own authenticator