Search in sources :

Example 1 with RememberMeDelegatingExpirationPolicy

use of org.apereo.cas.ticket.support.RememberMeDelegatingExpirationPolicy in project cas by apereo.

the class CasCoreTicketsConfiguration method grantingTicketExpirationPolicy.

@ConditionalOnMissingBean(name = "grantingTicketExpirationPolicy")
@Bean
public ExpirationPolicy grantingTicketExpirationPolicy() {
    final TicketGrantingTicketProperties tgt = casProperties.getTicket().getTgt();
    if (tgt.getRememberMe().isEnabled()) {
        final RememberMeDelegatingExpirationPolicy p = new RememberMeDelegatingExpirationPolicy();
        p.setRememberMeExpirationPolicy(new HardTimeoutExpirationPolicy(tgt.getRememberMe().getTimeToKillInSeconds()));
        p.setSessionExpirationPolicy(buildTicketGrantingTicketExpirationPolicy());
        return p;
    }
    return buildTicketGrantingTicketExpirationPolicy();
}
Also used : HardTimeoutExpirationPolicy(org.apereo.cas.ticket.support.HardTimeoutExpirationPolicy) TicketGrantingTicketProperties(org.apereo.cas.configuration.model.core.ticket.TicketGrantingTicketProperties) RememberMeDelegatingExpirationPolicy(org.apereo.cas.ticket.support.RememberMeDelegatingExpirationPolicy) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Aggregations

TicketGrantingTicketProperties (org.apereo.cas.configuration.model.core.ticket.TicketGrantingTicketProperties)1 HardTimeoutExpirationPolicy (org.apereo.cas.ticket.support.HardTimeoutExpirationPolicy)1 RememberMeDelegatingExpirationPolicy (org.apereo.cas.ticket.support.RememberMeDelegatingExpirationPolicy)1 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)1 Bean (org.springframework.context.annotation.Bean)1