Search in sources :

Example 1 with TGCCookieRetrievingCookieGenerator

use of org.apereo.cas.web.support.TGCCookieRetrievingCookieGenerator in project cas by apereo.

the class CasCookieConfiguration method ticketGrantingTicketCookieGenerator.

@Autowired
@Bean
@RefreshScope
public CookieRetrievingCookieGenerator ticketGrantingTicketCookieGenerator(@Qualifier("cookieCipherExecutor") final CipherExecutor cipherExecutor) {
    final TicketGrantingCookieProperties tgc = casProperties.getTgc();
    final int rememberMeMaxAge = Long.valueOf(tgc.getRememberMeMaxAge()).intValue();
    return new TGCCookieRetrievingCookieGenerator(cookieValueManager(cipherExecutor), tgc.getName(), tgc.getPath(), tgc.getDomain(), rememberMeMaxAge, tgc.isSecure(), tgc.getMaxAge());
}
Also used : TGCCookieRetrievingCookieGenerator(org.apereo.cas.web.support.TGCCookieRetrievingCookieGenerator) TicketGrantingCookieProperties(org.apereo.cas.configuration.model.support.cookie.TicketGrantingCookieProperties) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) Autowired(org.springframework.beans.factory.annotation.Autowired) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Example 2 with TGCCookieRetrievingCookieGenerator

use of org.apereo.cas.web.support.TGCCookieRetrievingCookieGenerator in project cas by apereo.

the class CasCookieConfiguration method ticketGrantingTicketCookieGenerator.

@Bean
@RefreshScope
public CookieRetrievingCookieGenerator ticketGrantingTicketCookieGenerator() {
    final TicketGrantingCookieProperties tgc = casProperties.getTgc();
    final int rememberMeMaxAge = (int) Beans.newDuration(tgc.getRememberMeMaxAge()).getSeconds();
    return new TGCCookieRetrievingCookieGenerator(cookieValueManager(), tgc.getName(), tgc.getPath(), tgc.getDomain(), rememberMeMaxAge, tgc.isSecure(), tgc.getMaxAge(), tgc.isHttpOnly());
}
Also used : TGCCookieRetrievingCookieGenerator(org.apereo.cas.web.support.TGCCookieRetrievingCookieGenerator) TicketGrantingCookieProperties(org.apereo.cas.configuration.model.support.cookie.TicketGrantingCookieProperties) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Aggregations

TicketGrantingCookieProperties (org.apereo.cas.configuration.model.support.cookie.TicketGrantingCookieProperties)2 TGCCookieRetrievingCookieGenerator (org.apereo.cas.web.support.TGCCookieRetrievingCookieGenerator)2 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)2 RefreshScope (org.springframework.cloud.context.config.annotation.RefreshScope)2 Bean (org.springframework.context.annotation.Bean)2 Autowired (org.springframework.beans.factory.annotation.Autowired)1