Custom Scenario help

Hi, this is my actual scenario:
1 vm samba server as AD/LDAP server
1 vm keycloak
1 external application that use LDAP for users authentication.

Can I ask a keycloak 2FA(with Google Authernticator) every time that user asks to authenticate in external application?
external application have only AD or LDAP connector.

if it is possible, how?

Thank you
Regards

You can store the OTP secret in LDAP and validate the OTP provided by the user in your application itself.

Hi, I have not understood how, can you link me an howto?

Thank you

What you want is probably TOTP. Search for for to implemente TOTP in the language of your project.