Sharing keys between realms

Hi everyone,

I have set up an environment with keycloak 18 for authenticating my users.
My users are declared in a LDAP bound to a realm (ex: myusers).
I’d like now to be able to authenticate some users with basic auth and some others with certificates (for using same applications).
I have configured X509 direct access authentication on my realm but sadly it applies to all users that will connect to my realm.
I would like now to create 2 realms (one for basic auth users and the other for certificate users) but then, I won’t be able to use generated tokens as they will be signed by different keys.
Based on these explainations, do you know if there is a way for configuring private keys on a realm?
I have found “Adding new realm keys from Java Key Store file” but I wonder what represent the various parameters of the command (ex: parentId) and how should keystore look like.

Thank you for your help

The way I see it, you can either have a authentication flow where x509 is alternative, not required.

Or it this is not possible, you can have two clients on the same realm, one overriding the browser flow to a username/password based authentication.