I need to configure an identity provider (OIDC type). The token endpoint need to be called with mTLS.
I have access to two version of keycloak (v9 and v15), both of them are running inside K8s
Modify your Deployment in order to mount this secret inside your workload.
Edit your standalone config file
In my case, I use specific actions.cli as my image is customized. At build time, a file containing actions is copy inside image. At launch time, these actions are run against the workload.
Here is the actions to add the keystore :
Another thing which is very useful to know is that if you use a PKCS12 (.p12 or .pfx) file as keystore, then you need to use the keystore password in both places. A PKCS12 keystore does not have a key password, only a keystore password, and without setting both properties.client-keystore-password and properties.client-key-password to the actual keystore password, you get into strange error messages related to crypto padding.
I have a requirement to check the feasibility of supporting mTLS (Keycloak to OIDC IDP Identity Broker) in a multitenant setup using custom code implementation. After conducting some research, I concluded that we should create a custom SPI for DefaultHttpClientFactory. The existing code will remain the same, except I would replace the values of clientKeystorePath, clientKeystorePassword, and clientPrivateKeyPassword with respective values. These values would be dynamic based on the realm (creating realm-specific keystores first and then using them here) same as edit standalone config file. Could you suggest if this approach will work or not? I am new to Keycloak and would appreciate any suggestions.