use of org.apereo.cas.web.pac4j.CasSecurityInterceptor in project cas by apereo.
the class CasSecurityContextConfiguration method requiresAuthenticationStatusAdminEndpointsInterceptor.
@RefreshScope
@Bean
public SecurityInterceptor requiresAuthenticationStatusAdminEndpointsInterceptor() {
final Config cfg = casAdminPagesPac4jConfig();
if (cfg.getClients() == null) {
return requiresAuthenticationStatusInterceptor();
}
final CasSecurityInterceptor interceptor = new CasSecurityInterceptor(cfg, CAS_CLIENT_NAME, "securityHeaders,csrfToken,".concat(getAuthorizerName()));
return interceptor;
}
use of org.apereo.cas.web.pac4j.CasSecurityInterceptor 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