use of org.apereo.cas.ticket.expiration.RememberMeDelegatingExpirationPolicy in project cas by apereo.
the class TicketGrantingTicketExpirationPolicyBuilderTests method verifyRememberMe.
@Test
public void verifyRememberMe() {
val props = new CasConfigurationProperties();
props.getTicket().getTgt().getRememberMe().setEnabled(true);
val builder = new TicketGrantingTicketExpirationPolicyBuilder(props);
assertTrue(builder.buildTicketExpirationPolicy() instanceof RememberMeDelegatingExpirationPolicy);
assertNotNull(builder.getTicketType());
assertNotNull(builder.toString());
assertNotNull(builder.getCasProperties());
}
use of org.apereo.cas.ticket.expiration.RememberMeDelegatingExpirationPolicy in project cas by apereo.
the class TicketGrantingTicketExpirationPolicyBuilder method toRememberMeTicketExpirationPolicy.
/**
* To remember-me ticket expiration policy.
*
* @return the expiration policy
*/
public ExpirationPolicy toRememberMeTicketExpirationPolicy() {
val tgt = casProperties.getTicket().getTgt();
LOGGER.debug("Remember me expiration policy is being configured based on hard timeout of [{}] seconds", tgt.getRememberMe().getTimeToKillInSeconds());
val rememberMePolicy = new HardTimeoutExpirationPolicy(tgt.getRememberMe().getTimeToKillInSeconds());
val p = new RememberMeDelegatingExpirationPolicy();
p.addPolicy(RememberMeDelegatingExpirationPolicy.POLICY_NAME_REMEMBER_ME, rememberMePolicy);
p.addPolicy(RememberMeDelegatingExpirationPolicy.POLICY_NAME_DEFAULT, toTicketGrantingTicketExpirationPolicy());
return p;
}
Aggregations