@Override public void configureAuthenticationExecutionPlan(final AuthenticationEventExecutionPlan plan) { plan.registerAuthenticationHandlerWithPrincipalResolver(tokenAuthenticationHandler(), personDirectoryPrincipalResolver); } }
@ConditionalOnMissingBean(name = "proxyAuthenticationEventExecutionPlanConfigurer") @Bean @ConditionalOnProperty(prefix = "cas.sso", name = "proxyAuthnEnabled", havingValue = "true", matchIfMissing = true) public AuthenticationEventExecutionPlanConfigurer proxyAuthenticationEventExecutionPlanConfigurer() { return plan -> plan.registerAuthenticationHandlerWithPrincipalResolver(proxyAuthenticationHandler(), proxyPrincipalResolver()); }
@ConditionalOnMissingBean(name = "trustedAuthenticationEventExecutionPlanConfigurer") @Bean public AuthenticationEventExecutionPlanConfigurer trustedAuthenticationEventExecutionPlanConfigurer() { return plan -> plan.registerAuthenticationHandlerWithPrincipalResolver(principalBearingCredentialsAuthenticationHandler(), trustedPrincipalResolver()); } }
@ConditionalOnMissingBean(name = "x509AuthenticationEventExecutionPlanConfigurer") @Bean public AuthenticationEventExecutionPlanConfigurer x509AuthenticationEventExecutionPlanConfigurer() { return plan -> { val resolver = getPrincipalResolver(); plan.registerAuthenticationHandlerWithPrincipalResolver(x509CredentialsAuthenticationHandler(), resolver); }; }
@ConditionalOnMissingBean(name = "spnegoAuthenticationEventExecutionPlanConfigurer") @Bean public AuthenticationEventExecutionPlanConfigurer spnegoAuthenticationEventExecutionPlanConfigurer() { return plan -> plan.registerAuthenticationHandlerWithPrincipalResolver(spnegoHandler(), spnegoPrincipalResolver()); } }
@ConditionalOnMissingBean(name = "openIdAuthenticationEventExecutionPlanConfigurer") @Bean public AuthenticationEventExecutionPlanConfigurer openIdAuthenticationEventExecutionPlanConfigurer() { return plan -> plan.registerAuthenticationHandlerWithPrincipalResolver(openIdCredentialsAuthenticationHandler(), openIdPrincipalResolver()); } }
@ConditionalOnMissingBean(name = "tokenAuthenticationEventExecutionPlanConfigurer") @Bean public AuthenticationEventExecutionPlanConfigurer tokenAuthenticationEventExecutionPlanConfigurer() { return plan -> plan.registerAuthenticationHandlerWithPrincipalResolver(tokenAuthenticationHandler(), defaultPrincipalResolver.getIfAvailable()); } }
@ConditionalOnMissingBean(name = "ldapAuthenticationEventExecutionPlanConfigurer") @Bean public AuthenticationEventExecutionPlanConfigurer ldapAuthenticationEventExecutionPlanConfigurer() { return plan -> ldapAuthenticationHandlers().forEach(handler -> { LOGGER.info("Registering LDAP authentication for [{}]", handler.getName()); plan.registerAuthenticationHandlerWithPrincipalResolver(handler, defaultPrincipalResolver.getIfAvailable()); }); } }
@ConditionalOnMissingBean(name = "jdbcAuthenticationEventExecutionPlanConfigurer") @Bean @RefreshScope public AuthenticationEventExecutionPlanConfigurer jdbcAuthenticationEventExecutionPlanConfigurer() { return plan -> jdbcAuthenticationHandlers().forEach(h -> plan.registerAuthenticationHandlerWithPrincipalResolver(h, defaultPrincipalResolver.getIfAvailable())); }
@ConditionalOnMissingBean(name = "jsonResourceAuthenticationEventExecutionPlanConfigurer") @Bean public AuthenticationEventExecutionPlanConfigurer jsonResourceAuthenticationEventExecutionPlanConfigurer() { return plan -> { val file = casProperties.getAuthn().getJson().getLocation(); if (file != null) { LOGGER.debug("Added JSON resource authentication handler for the target file [{}]", file.getFilename()); plan.registerAuthenticationHandlerWithPrincipalResolver(jsonResourceAuthenticationHandler(), defaultPrincipalResolver.getIfAvailable()); } }; } }
@ConditionalOnMissingBean(name = "rejectUsersAuthenticationEventExecutionPlanConfigurer") @Bean public AuthenticationEventExecutionPlanConfigurer rejectUsersAuthenticationEventExecutionPlanConfigurer() { return plan -> { val users = casProperties.getAuthn().getReject().getUsers(); if (StringUtils.isNotBlank(users)) { plan.registerAuthenticationHandlerWithPrincipalResolver(rejectUsersAuthenticationHandler(), defaultPrincipalResolver.getIfAvailable()); LOGGER.debug("Added rejecting authentication handler with the following users [{}]", users); } }; }
@ConditionalOnMissingBean(name = "pac4jAuthenticationEventExecutionPlanConfigurer") @Bean public AuthenticationEventExecutionPlanConfigurer pac4jAuthenticationEventExecutionPlanConfigurer() { return plan -> { if (!builtClients().findAllClients().isEmpty()) { LOGGER.info("Registering delegated authentication clients..."); plan.registerAuthenticationHandlerWithPrincipalResolver(clientAuthenticationHandler(), defaultPrincipalResolver.getIfAvailable()); plan.registerAuthenticationMetadataPopulator(clientAuthenticationMetaDataPopulator()); } }; }
@ConditionalOnMissingBean(name = "fileAuthenticationEventExecutionPlanConfigurer") @Bean public AuthenticationEventExecutionPlanConfigurer fileAuthenticationEventExecutionPlanConfigurer() { return plan -> { val file = casProperties.getAuthn().getFile().getFilename(); if (file != null) { LOGGER.debug("Added file-based authentication handler for the target file [{}]", file.getDescription()); plan.registerAuthenticationHandlerWithPrincipalResolver(fileAuthenticationHandler(), defaultPrincipalResolver.getIfAvailable()); } }; }
@ConditionalOnMissingBean(name = "acceptUsersAuthenticationEventExecutionPlanConfigurer") @Bean @RefreshScope public AuthenticationEventExecutionPlanConfigurer acceptUsersAuthenticationEventExecutionPlanConfigurer() { return plan -> { if (StringUtils.isNotBlank(this.casProperties.getAuthn().getAccept().getUsers())) { val header = "\nCAS is configured to accept a static list of credentials for authentication. " + "While this is generally useful for demo purposes, it is STRONGLY recommended " + "that you DISABLE this authentication method (by setting 'cas.authn.accept.users' " + "to a blank value) and switch to a mode that is more suitable for production."; AsciiArtUtils.printAsciiArtWarning(LOGGER, "STOP!", header); plan.registerAuthenticationHandlerWithPrincipalResolver(acceptUsersAuthenticationHandler.getIfAvailable(), defaultPrincipalResolver.getIfAvailable()); } }; } }
cfg, personDirectory.isUseExistingPrincipalId() || principal.isUseExistingPrincipalId()); plan.registerAuthenticationHandlerWithPrincipalResolver(handler, r);