Conditional OTP for Direct Grant

Hi KC Community,

Is it possible to have a conditional OTP execution for Direct Grant Flow where KC can request and verify TOTP only if a user has a specific role?

I need something similar to a Conditional OTP Form which is working for a Browser Flow…

Thanks,
Massimo