How to have attribute visible only if a value is check during authentification?

Hello everybody,

For my use case, I need to have an attributu visible only if a value is check during authentification.

Let me explain, I have the attribute A which can have two values : value A and value B.
And I want make visible my attribute B only if value A of the attribute A are check.

How can do this? For now I use the user profile in keycloak.

For do this, I need to personalize the template base/login/register-user-profile.ftl ?
Or I can do this validator and annotation only ?

Thanks in advance and sorry for my bad english.

Gaƫl