Hi Jérôme,
I think your observations are correct, i.e. there is currently no way how to disable SMS just for Simple MFA via CAS configuration.
The only option here seems to override the
mfaSimpleMultifactorTokenCommunicationStrategy bean (as per
this CAS guide) with an instance that would return something else than the default
ALL = EnumSet.allOf(TokenSharingStrategyOptions.class);. For reference, the OOTB bean is defined as follows:
@ConditionalOnMissingBean(name = CasSimpleMultifactorTokenCommunicationStrategy.BEAN_NAME)
@Bean
@RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
public CasSimpleMultifactorTokenCommunicationStrategy mfaSimpleMultifactorTokenCommunicationStrategy() {
return CasSimpleMultifactorTokenCommunicationStrategy.all();
}
If you need even more control over the sending process, you can override the whole CasSimpleMultifactorSendTokenAction class - but it would be probably an overkill in this case.
Best regards
Petr