Search in sources :

Example 1 with SurrogateSessionExpirationPolicy

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

the class SurrogateAuthenticationConfiguration method grantingTicketExpirationPolicy.

@Bean
public ExpirationPolicy grantingTicketExpirationPolicy(@Qualifier("ticketGrantingTicketExpirationPolicy") final ExpirationPolicy ticketGrantingTicketExpirationPolicy) {
    final SurrogateAuthenticationProperties su = casProperties.getAuthn().getSurrogate();
    final HardTimeoutExpirationPolicy surrogatePolicy = new HardTimeoutExpirationPolicy(su.getTgt().getTimeToKillInSeconds());
    final SurrogateSessionExpirationPolicy policy = new SurrogateSessionExpirationPolicy(surrogatePolicy);
    policy.addPolicy(SurrogateSessionExpirationPolicy.PolicyTypes.SURROGATE, surrogatePolicy);
    policy.addPolicy(SurrogateSessionExpirationPolicy.PolicyTypes.DEFAULT, ticketGrantingTicketExpirationPolicy);
    return policy;
}
Also used : SurrogateAuthenticationProperties(org.apereo.cas.configuration.model.support.surrogate.SurrogateAuthenticationProperties) HardTimeoutExpirationPolicy(org.apereo.cas.ticket.support.HardTimeoutExpirationPolicy) SurrogateSessionExpirationPolicy(org.apereo.cas.ticket.support.SurrogateSessionExpirationPolicy) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Aggregations

SurrogateAuthenticationProperties (org.apereo.cas.configuration.model.support.surrogate.SurrogateAuthenticationProperties)1 HardTimeoutExpirationPolicy (org.apereo.cas.ticket.support.HardTimeoutExpirationPolicy)1 SurrogateSessionExpirationPolicy (org.apereo.cas.ticket.support.SurrogateSessionExpirationPolicy)1 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)1 Bean (org.springframework.context.annotation.Bean)1