@ConditionalOnMissingBean(name = "microsoftAzureActiveDirectoryAuthenticationHandler")
        @Bean
        @RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
        public AuthenticationHandler microsoftAzureActiveDirectoryAuthenticationHandler(
            final ConfigurableApplicationContext applicationContext,
            @Qualifier(ServicesManager.BEAN_NAME)
            final ServicesManager servicesManager,
            final CasConfigurationProperties casProperties,
            @Qualifier("microsoftAzureActiveDirectoryPrincipalFactory")
            final PrincipalFactory factory) {
            return BeanSupplier.of(AuthenticationHandler.class)
                .when(CONDITION.given(applicationContext.getEnvironment()))
                .supply(() -> {
                    val azure = casProperties.getAuthn().getAzureActiveDirectory();
                    val handler = new AzureActiveDirectoryAuthenticationHandler(servicesManager, factory, azure);
                    handler.setState(azure.getState());
                    handler.setPrincipalNameTransformer(PrincipalNameTransformerUtils.newPrincipalNameTransformer(azure.getPrincipalTransformation()));
                    handler.setPasswordEncoder(PasswordEncoderUtils.newPasswordEncoder(azure.getPasswordEncoder(), applicationContext));
                    handler.setCredentialSelectionPredicate(CoreAuthenticationUtils.newCredentialSelectionPredicate(azure.getCredentialCriteria()));
                    return handler;
                })
                .otherwiseProxy()
                .get();
        }
This is {@link CasAzureActiveDirectoryAuthenticationAutoConfiguration}.

@author Misagh Moayyed
@since 6.2.0
support/cas-server-support-azuread-authentication/src/main/java/org/apereo/cas/config/CasAzureActiveDirectoryAuthenticationAutoConfiguration.java