Perform 2FA on specific screens with keycloak

I have an application using spring boot, angular and keycloak in version 18.0. In the application’s keycloak I have all the users with the 2FA keycloak configured, however the keycloak only requires the code when logging into the system. I would like to know if there is any solution to request the OTP code in critical system screens.

Example of desired flow: I login to the system and provide the OTP code, access the critical screen X and request the OTP code again

Look for „Step-Up Authentication“, this is most likely your friend…