use of org.apereo.cas.configuration.model.support.surrogate.SurrogateAuthenticationProperties in project cas by apereo.
the class SurrogateLdapAuthenticationConfiguration method surrogateAuthenticationService.
@RefreshScope
@Bean
public SurrogateAuthenticationService surrogateAuthenticationService() {
final SurrogateAuthenticationProperties su = casProperties.getAuthn().getSurrogate();
LOGGER.debug("Using LDAP [{}] with baseDn [{}] to locate surrogate accounts", su.getLdap().getLdapUrl(), su.getLdap().getBaseDn());
final ConnectionFactory factory = LdapUtils.newLdaptivePooledConnectionFactory(su.getLdap());
return new SurrogateLdapAuthenticationService(factory, su.getLdap(), servicesManager);
}
use of org.apereo.cas.configuration.model.support.surrogate.SurrogateAuthenticationProperties in project cas by apereo.
the class SurrogateAuthenticationConfiguration method grantingTicketExpirationPolicy.
@Bean
public ExpirationPolicy grantingTicketExpirationPolicy(@Qualifier("ticketGrantingTicketExpirationPolicy") final ExpirationPolicy ticketGrantingTicketExpirationPolicy) {
final SurrogateAuthenticationProperties su = casProperties.getAuthn().getSurrogate();
final HardTimeoutExpirationPolicy surrogatePolicy = new HardTimeoutExpirationPolicy(su.getTgt().getTimeToKillInSeconds());
final SurrogateSessionExpirationPolicy policy = new SurrogateSessionExpirationPolicy(surrogatePolicy);
policy.addPolicy(SurrogateSessionExpirationPolicy.PolicyTypes.SURROGATE, surrogatePolicy);
policy.addPolicy(SurrogateSessionExpirationPolicy.PolicyTypes.DEFAULT, ticketGrantingTicketExpirationPolicy);
return policy;
}
use of org.apereo.cas.configuration.model.support.surrogate.SurrogateAuthenticationProperties in project cas by apereo.
the class SurrogateRestAuthenticationConfiguration method surrogateAuthenticationService.
@RefreshScope
@Bean
public SurrogateAuthenticationService surrogateAuthenticationService() {
final SurrogateAuthenticationProperties su = casProperties.getAuthn().getSurrogate();
LOGGER.debug("Using REST endpoint [{}] with method [{}] to locate surrogate accounts", su.getRest().getUrl(), su.getRest().getMethod());
return new SurrogateRestAuthenticationService(su.getRest(), servicesManager);
}
use of org.apereo.cas.configuration.model.support.surrogate.SurrogateAuthenticationProperties in project cas by apereo.
the class SurrogateAuthenticationConfiguration method surrogateAuthenticationService.
@RefreshScope
@ConditionalOnMissingBean(name = "surrogateAuthenticationService")
@Bean
@SneakyThrows
public SurrogateAuthenticationService surrogateAuthenticationService() {
final SurrogateAuthenticationProperties su = casProperties.getAuthn().getSurrogate();
if (su.getJson().getLocation() != null) {
LOGGER.debug("Using JSON resource [{}] to locate surrogate accounts", su.getJson().getLocation());
return new JsonResourceSurrogateAuthenticationService(su.getJson().getLocation(), servicesManager);
}
final Map<String, Set> accounts = new LinkedHashMap<>();
su.getSimple().getSurrogates().forEach((k, v) -> accounts.put(k, StringUtils.commaDelimitedListToSet(v)));
LOGGER.debug("Using accounts [{}] for surrogate authentication", accounts);
return new SimpleSurrogateAuthenticationService(accounts, servicesManager);
}
Aggregations