use of org.apereo.cas.configuration.model.support.cookie.TicketGrantingCookieProperties in project cas by apereo.
the class CasThemesConfiguration method themeResolver.
@ConditionalOnMissingBean(name = "themeResolver")
@Bean
public ThemeResolver themeResolver() {
final String defaultThemeName = casProperties.getTheme().getDefaultThemeName();
final FixedThemeResolver fixedResolver = new FixedThemeResolver();
fixedResolver.setDefaultThemeName(defaultThemeName);
final SessionThemeResolver sessionThemeResolver = new SessionThemeResolver();
sessionThemeResolver.setDefaultThemeName(defaultThemeName);
final TicketGrantingCookieProperties tgc = casProperties.getTgc();
final CookieThemeResolver cookieThemeResolver = new CookieThemeResolver();
cookieThemeResolver.setDefaultThemeName(defaultThemeName);
cookieThemeResolver.setCookieDomain(tgc.getDomain());
cookieThemeResolver.setCookieHttpOnly(tgc.isHttpOnly());
cookieThemeResolver.setCookieMaxAge(tgc.getMaxAge());
cookieThemeResolver.setCookiePath(tgc.getPath());
cookieThemeResolver.setCookieSecure(tgc.isSecure());
final RegisteredServiceThemeResolver serviceThemeResolver = new RegisteredServiceThemeResolver(servicesManager, serviceThemeResolverSupportedBrowsers(), authenticationRequestServiceSelectionStrategies, this.resourceLoader, new CasConfigurationProperties());
serviceThemeResolver.setDefaultThemeName(defaultThemeName);
final RequestHeaderThemeResolver header = new RequestHeaderThemeResolver();
header.setDefaultThemeName(defaultThemeName);
final ChainingThemeResolver chainingThemeResolver = new ChainingThemeResolver();
chainingThemeResolver.addResolver(cookieThemeResolver).addResolver(sessionThemeResolver).addResolver(header).addResolver(serviceThemeResolver).addResolver(fixedResolver);
chainingThemeResolver.setDefaultThemeName(defaultThemeName);
return chainingThemeResolver;
}
use of org.apereo.cas.configuration.model.support.cookie.TicketGrantingCookieProperties 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());
}
use of org.apereo.cas.configuration.model.support.cookie.TicketGrantingCookieProperties 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());
}
Aggregations