Good day, I was wondering if any anyone has information on how to implement 2fa using OTP in keycloak with a custom user storage SPI.
I already have an extension for my SQL Server database, and I can login using their password (BCrypt). But, I can't configure OPT for them, since they are Read-only users (Federated). Reading the documentation, I found that users from LDAP can be synced into keycloak to be able to do this (obviously with the writing overhead).
Does anyone has any idea on how to do this? or maybe, how to enable this without caching them locally?
Well, I was wrong with my previous answer, I will leave it there just because it might be usefull for someone else, so, here's the full history on how to do this...
Well, finally after more than a week (on my new project) I got this working with Keycloak 18.0. What do you need to do?, simply, you have to implement each and every step in the authentication workflow:
In my opinion, this is kinda annoying, since there are a lot of loops we have to make to be able to store our data locally and how to deal with the integrated OTP forms (for a "natural look"), but it gives me full control over my OTP integration, also, I can backup my database and their OTP authentication is still there, so, if I have a failure in a KC upgrade or it gets corrupted, I still have all that data.
Lastly, heres what it should look like when your manager has the custom OTP authentication