@ConditionalOnMissingBean(name = "amazonCognitoAuthenticationHandler")
    @RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
    @Bean
    public AuthenticationHandler amazonCognitoAuthenticationHandler(
        final CasConfigurationProperties casProperties, final ConfigurableApplicationContext applicationContext,
        @Qualifier("amazonCognitoPrincipalFactory")
        final PrincipalFactory amazonCognitoPrincipalFactory,
        @Qualifier("amazonCognitoIdentityProvider")
        final CognitoIdentityProviderClient amazonCognitoIdentityProvider,
        @Qualifier("amazonCognitoAuthenticationJwtProcessor")
        final ConfigurableJWTProcessor amazonCognitoAuthenticationJwtProcessor,
        @Qualifier(ServicesManager.BEAN_NAME)
        final ServicesManager servicesManager) {
        val cognito = casProperties.getAuthn().getCognito();
        val handler = new AmazonCognitoAuthenticationAuthenticationHandler(servicesManager,
            amazonCognitoPrincipalFactory, amazonCognitoIdentityProvider, cognito,
            amazonCognitoAuthenticationJwtProcessor);
        handler.setState(cognito.getState());
        handler.setPrincipalNameTransformer(PrincipalNameTransformerUtils.newPrincipalNameTransformer(cognito.getPrincipalTransformation()));
        handler.setPasswordEncoder(PasswordEncoderUtils.newPasswordEncoder(cognito.getPasswordEncoder(), applicationContext));
        return handler;
    }
This is {@link CasAmazonCognitoAuthenticationAutoConfiguration}.

@author Misagh Moayyed
@since 6.0.0
support/cas-server-support-aws-cognito-authentication/src/main/java/org/apereo/cas/config/CasAmazonCognitoAuthenticationAutoConfiguration.java