This library provides integration with distributed Infinispan cache.
Checkout the code and use the following maven command to build the project
mvn clean install
Below is an example on how to use this library on a Spring Boot application on Wildfly/JBoss
<dependency>
<groupId>org.kamranzafar.cas.client</groupId>
<artifactId>cas-client-support-distributed-infinispan</artifactId>
<version>1.0</version>
</dependency>
// Lookup the relevant Cache that will be used to store CAS proxy granting tickets
@Bean
public Cache defaultCache() throws NamingException {
return (Cache) ((DefaultCacheContainer) new JndiTemplate().lookup("java:jboss/infinispan/container/sso")).getCache();
}
.
.
.
// Create the bean
@Bean
public ProxyGrantingTicketStorage proxyGrantingTicketStorage(){
return new InfinispanProxyGrantingTicketStorage(defaultCache());
}
.
.
.
// Setup CasAuthenticationFilter to use Infinispan
CasAuthenticationFilter casAuthenticationFilter = new CasAuthenticationFilter();
casAuthenticationFilter.setProxyGrantingTicketStorage(proxyGrantingTicketStorage());
.
.
// Setup Cas20ProxyTicketValidator to use Infinispan
Cas20ProxyTicketValidator cas20ProxyTicketValidator = new Cas20ProxyTicketValidator("...");
cas20ProxyTicketValidator.setProxyGrantingTicketStorage(proxyGrantingTicketStorage());