Hi Yan
I did quite the same thing. I'm just curious : How are your users registering their mfa methods and devices ?
In my case, a user is autonomous and is able to register mfa devices (gauth and webauthn) on his own thru the account manager.
Then I'm using bypass groovy scripts to check if he has registered at least one device for each mfa provider. He's got the mfa selection menu if he has Registered at least one provider. To do so I used thoses endpoints for both groovy bypass scripts :
/cas/actuator/gauthCredentialRepository/${userId}
/cas/actuator/webAuthnDevices/${userId}
(notice that those endpoints are protected by acls in cas.monitor.endpoints.endpoint.gauthCredentialRepository/webAuthnDevices/multifactorTrustedDevices.access allowing requests only from localhost for security purposes)
This way the user choose when to activate his own providers and he does not have to access an external portal to activate mfa, or, that admins force this behavior for a user thru the attributeRepository.
Cons : When a user has registered only one mfa provider, the mfa provider selector selection menu is still popping out. If anybody knows a trick … ;-)
Regards,