protected Set < Event > resolveMultifactorAuthenticationProvider ( final Optional < RequestContext > context , final RegisteredService service , final Principal principal ) { val globalPrincipalAttributeValueRegex = casProperties . getAuthn ( ) . getMfa ( ) . getGlobalPrincipalAttributeValueRegex ( ) ; val providerMap = MultifactorAuthenticationUtils . getAvailableMultifactorAuthenticationProviders ( ApplicationContextProvider . getApplicationContext ( ) ) ; val providers = providerMap . values ( ) ; if ( providers . size ( ) == 1 && StringUtils . isNotBlank ( globalPrincipalAttributeValueRegex ) ) { return resolveSingleMultifactorProvider ( context , service , principal , providers ) ; } return resolveMultifactorProviderViaPredicate ( context , service , principal , providers ) ; }
Resolve multifactor authentication provider set .