use of org.apereo.cas.authentication.surrogate.SimpleSurrogateAuthenticationService 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