use of org.pac4j.http.credentials.extractor.IpExtractor in project cas by apereo.
the class CasSecurityContextConfiguration method requiresAuthenticationStatusInterceptor.
@RefreshScope
@Bean
public SecurityInterceptor requiresAuthenticationStatusInterceptor() {
final AdminPagesSecurityProperties secProps = casProperties.getAdminPagesSecurity();
final IpRegexpAuthenticator authn = new IpRegexpAuthenticator(secProps.getIp());
final IpClient ipClient = new IpClient(authn);
final Set<String> headerNames = org.springframework.util.StringUtils.commaDelimitedListToSet(secProps.getAlternateIpHeaderName());
final IpExtractor credentialsExtractor = new IpExtractor(headerNames.toArray(new String[] {}));
ipClient.setCredentialsExtractor(credentialsExtractor);
return new CasSecurityInterceptor(new Config(ipClient), ipClient.getClass().getSimpleName());
}
Aggregations