Java 类org.springframework.web.util.CookieGenerator 实例源码

项目:logsniffer    文件:CookieTokenProvider.java   
@Override
public String getToken(final HttpServletRequest request, final HttpServletResponse response) {
    final Cookie tokenCookie = WebUtils.getCookie(request, COOKIE_KEY);
    if (tokenCookie != null && tokenCookie.getValue() != null) {
        logger.debug("Detected profile token from cookie: {}", tokenCookie.getValue());
        return tokenCookie.getValue();
    }
    final String token = UUID.randomUUID().toString();
    final CookieGenerator g = new CookieGenerator();
    g.setCookieMaxAge(Integer.MAX_VALUE);
    g.setCookiePath("/");
    g.setCookieName(COOKIE_KEY);
    g.addCookie(response, token);
    logger.debug("Generated a new token: {}", token);
    return token;
}
项目:springboot-shiro-cas-mybatis    文件:AuthenticationViaFormActionTests.java   
@Before
public void onSetUp() throws Exception {
    this.action = new AuthenticationViaFormAction();

    this.warnCookieGenerator = new CookieGenerator();
    this.warnCookieGenerator.setCookieName("WARN");
    this.warnCookieGenerator.setCookieName("TGT");
    this.warnCookieGenerator.setCookieDomain("/");
    this.warnCookieGenerator.setCookiePath("/");

    this.action.setCentralAuthenticationService(getCentralAuthenticationService());
    this.action.setAuthenticationSystemSupport(getAuthenticationSystemSupport());
    this.action.setWarnCookieGenerator(this.warnCookieGenerator);
}
项目:springboot-shiro-cas-mybatis    文件:WebUtils.java   
/**
 * Put warn cookie if request parameter present.
 *
 * @param warnCookieGenerator the warn cookie generator
 * @param context             the context
 */
public static void putWarnCookieIfRequestParameterPresent(final CookieGenerator warnCookieGenerator, final RequestContext context) {
    if (warnCookieGenerator != null) {
        LOGGER.debug("Evaluating request to determine if warning cookie should be generated");
        final HttpServletResponse response = WebUtils.getHttpServletResponse(context);
        if (StringUtils.isNotBlank(context.getExternalContext().getRequestParameterMap().get("warn"))) {
            warnCookieGenerator.addCookie(response, "true");
        } else {
            warnCookieGenerator.removeCookie(response);
        }
    } else {
        LOGGER.debug("No warning cookie generator is defined");
    }
}
项目:springboot-shiro-cas-mybatis    文件:AuthenticationViaFormActionTests.java   
@Before
public void onSetUp() throws Exception {
    this.action = new AuthenticationViaFormAction();

    this.warnCookieGenerator = new CookieGenerator();
    this.warnCookieGenerator.setCookieName("WARN");
    this.warnCookieGenerator.setCookieName("TGT");
    this.warnCookieGenerator.setCookieDomain("/");
    this.warnCookieGenerator.setCookiePath("/");

    this.action.setCentralAuthenticationService(getCentralAuthenticationService());
    this.action.setWarnCookieGenerator(this.warnCookieGenerator);
}
项目:cas-5.1.0    文件:RadiusAuthenticationWebflowEventResolver.java   
public RadiusAuthenticationWebflowEventResolver(final AuthenticationSystemSupport authenticationSystemSupport,
                                                final CentralAuthenticationService centralAuthenticationService, 
                                                final ServicesManager servicesManager,
                                                final TicketRegistrySupport ticketRegistrySupport, 
                                                final CookieGenerator warnCookieGenerator,
                                                final AuthenticationServiceSelectionPlan authenticationSelectionStrategies,
                                                final MultifactorAuthenticationProviderSelector selector) {
    super(authenticationSystemSupport, centralAuthenticationService, 
            servicesManager, ticketRegistrySupport, warnCookieGenerator,
            authenticationSelectionStrategies, selector);
}
项目:cas-5.1.0    文件:GrouperMultifactorAuthenticationPolicyEventResolver.java   
public GrouperMultifactorAuthenticationPolicyEventResolver(final AuthenticationSystemSupport authenticationSystemSupport,
                                                           final CentralAuthenticationService centralAuthenticationService,
                                                           final ServicesManager servicesManager, final TicketRegistrySupport ticketRegistrySupport,
                                                           final CookieGenerator warnCookieGenerator,
                                                           final AuthenticationServiceSelectionPlan authenticationSelectionStrategies,
                                                           final MultifactorAuthenticationProviderSelector selector,
                                                           final CasConfigurationProperties casProperties) {
    super(authenticationSystemSupport, centralAuthenticationService, servicesManager, ticketRegistrySupport, warnCookieGenerator,
            authenticationSelectionStrategies, selector);
    grouperField = casProperties.getAuthn().getMfa().getGrouperGroupField().toUpperCase();
}
项目:cas-5.1.0    文件:RiskAwareAuthenticationWebflowEventResolver.java   
public RiskAwareAuthenticationWebflowEventResolver(final AuthenticationSystemSupport authenticationSystemSupport,
                                                   final CentralAuthenticationService centralAuthenticationService, final ServicesManager servicesManager,
                                                   final TicketRegistrySupport ticketRegistrySupport, final CookieGenerator warnCookieGenerator,
                                                   final AuthenticationServiceSelectionPlan authenticationSelectionStrategies,
                                                   final MultifactorAuthenticationProviderSelector selector,
                                                   final AuthenticationRiskEvaluator authenticationRiskEvaluator,
                                                   final AuthenticationRiskMitigator authenticationRiskMitigator,
                                                   final CasConfigurationProperties casProperties) {
    super(authenticationSystemSupport, centralAuthenticationService, servicesManager, ticketRegistrySupport, warnCookieGenerator,
            authenticationSelectionStrategies, selector);
    this.authenticationRiskEvaluator = authenticationRiskEvaluator;
    this.authenticationRiskMitigator = authenticationRiskMitigator;
    threshold = casProperties.getAuthn().getAdaptive().getRisk().getThreshold();
}
项目:cas-5.1.0    文件:YubiKeyAuthenticationWebflowEventResolver.java   
public YubiKeyAuthenticationWebflowEventResolver(final AuthenticationSystemSupport authenticationSystemSupport,
                                                 final CentralAuthenticationService centralAuthenticationService, final ServicesManager servicesManager,
                                                 final TicketRegistrySupport ticketRegistrySupport, final CookieGenerator warnCookieGenerator,
                                                 final AuthenticationServiceSelectionPlan authenticationSelectionStrategies,
                                                 final MultifactorAuthenticationProviderSelector selector) {
    super(authenticationSystemSupport, centralAuthenticationService, servicesManager, ticketRegistrySupport, warnCookieGenerator,
            authenticationSelectionStrategies, selector);
}
项目:cas-5.1.0    文件:OidcAuthenticationContextWebflowEventEventResolver.java   
public OidcAuthenticationContextWebflowEventEventResolver(final AuthenticationSystemSupport authenticationSystemSupport,
                                                          final CentralAuthenticationService centralAuthenticationService,
                                                          final ServicesManager servicesManager,
                                                          final TicketRegistrySupport ticketRegistrySupport,
                                                          final CookieGenerator warnCookieGenerator,
                                                          final AuthenticationServiceSelectionPlan authenticationSelectionStrategies,
                                                          final MultifactorAuthenticationProviderSelector selector) {
    super(authenticationSystemSupport, centralAuthenticationService, servicesManager,
            ticketRegistrySupport, warnCookieGenerator,
            authenticationSelectionStrategies, selector);
}
项目:cas-5.1.0    文件:OneTimeTokenAuthenticationWebflowEventResolver.java   
public OneTimeTokenAuthenticationWebflowEventResolver(final AuthenticationSystemSupport authenticationSystemSupport,
                                                      final CentralAuthenticationService centralAuthenticationService,
                                                      final ServicesManager servicesManager,
                                                      final TicketRegistrySupport ticketRegistrySupport,
                                                      final CookieGenerator warnCookieGenerator,
                                                      final AuthenticationServiceSelectionPlan authenticationSelectionStrategies,
                                                      final MultifactorAuthenticationProviderSelector selector) {
    super(authenticationSystemSupport, centralAuthenticationService, servicesManager,
            ticketRegistrySupport, warnCookieGenerator,
            authenticationSelectionStrategies, selector);
}
项目:cas-5.1.0    文件:AuthyAuthenticationWebflowEventResolver.java   
public AuthyAuthenticationWebflowEventResolver(final AuthenticationSystemSupport authenticationSystemSupport,
                                               final CentralAuthenticationService centralAuthenticationService, final ServicesManager servicesManager,
                                               final TicketRegistrySupport ticketRegistrySupport, final CookieGenerator warnCookieGenerator,
                                               final AuthenticationServiceSelectionPlan authenticationSelectionStrategies,
                                               final MultifactorAuthenticationProviderSelector selector) {
    super(authenticationSystemSupport, centralAuthenticationService, servicesManager, ticketRegistrySupport, warnCookieGenerator,
            authenticationSelectionStrategies, selector);
}
项目:cas-5.1.0    文件:SurrogateWebflowEventResolver.java   
public SurrogateWebflowEventResolver(final AuthenticationSystemSupport authenticationSystemSupport,
                                     final CentralAuthenticationService centralAuthenticationService,
                                     final ServicesManager servicesManager,
                                     final TicketRegistrySupport ticketRegistrySupport,
                                     final CookieGenerator warnCookieGenerator,
                                     final AuthenticationServiceSelectionPlan authenticationSelectionStrategies,
                                     final MultifactorAuthenticationProviderSelector selector,
                                     final SurrogateAuthenticationService surrogateService) {
    super(authenticationSystemSupport, centralAuthenticationService, servicesManager, ticketRegistrySupport,
            warnCookieGenerator, authenticationSelectionStrategies, selector);
    this.surrogateService = surrogateService;
}
项目:cas-5.1.0    文件:DuoAuthenticationWebflowEventResolver.java   
public DuoAuthenticationWebflowEventResolver(final AuthenticationSystemSupport authenticationSystemSupport,
                                             final CentralAuthenticationService centralAuthenticationService, final ServicesManager servicesManager,
                                             final TicketRegistrySupport ticketRegistrySupport, final CookieGenerator warnCookieGenerator,
                                             final AuthenticationServiceSelectionPlan authenticationSelectionStrategies,
                                             final MultifactorAuthenticationProviderSelector selector) {
    super(authenticationSystemSupport, centralAuthenticationService, servicesManager, ticketRegistrySupport, warnCookieGenerator,
            authenticationSelectionStrategies, selector);
}
项目:cas-5.1.0    文件:U2FAuthenticationWebflowEventResolver.java   
public U2FAuthenticationWebflowEventResolver(final AuthenticationSystemSupport authenticationSystemSupport,
                                             final CentralAuthenticationService centralAuthenticationService,
                                             final ServicesManager servicesManager,
                                             final TicketRegistrySupport ticketRegistrySupport,
                                             final CookieGenerator warnCookieGenerator,
                                             final AuthenticationServiceSelectionPlan authenticationSelectionStrategies,
                                             final MultifactorAuthenticationProviderSelector selector) {
    super(authenticationSystemSupport, centralAuthenticationService, servicesManager,
            ticketRegistrySupport, warnCookieGenerator,
            authenticationSelectionStrategies, selector);
}
项目:cas-5.1.0    文件:BaseMultifactorAuthenticationProviderEventResolver.java   
public BaseMultifactorAuthenticationProviderEventResolver(final AuthenticationSystemSupport authenticationSystemSupport,
                                                          final CentralAuthenticationService centralAuthenticationService,
                                                          final ServicesManager servicesManager,
                                                          final TicketRegistrySupport ticketRegistrySupport,
                                                          final CookieGenerator warnCookieGenerator,
                                                          final AuthenticationServiceSelectionPlan authenticationSelectionStrategies,
                                                          final MultifactorAuthenticationProviderSelector selector) {
    super(authenticationSystemSupport, centralAuthenticationService, servicesManager,
            ticketRegistrySupport, warnCookieGenerator,
            authenticationSelectionStrategies, selector);
}
项目:cas-5.1.0    文件:PrincipalAttributeMultifactorAuthenticationPolicyEventResolver.java   
public PrincipalAttributeMultifactorAuthenticationPolicyEventResolver(final AuthenticationSystemSupport authenticationSystemSupport,
                                                                      final CentralAuthenticationService centralAuthenticationService,
                                                                      final ServicesManager servicesManager,
                                                                      final TicketRegistrySupport ticketRegistrySupport,
                                                                      final CookieGenerator warnCookieGenerator,
                                                                      final AuthenticationServiceSelectionPlan authSelectionStrategies,
                                                                      final MultifactorAuthenticationProviderSelector selector,
                                                                      final CasConfigurationProperties casProperties) {
    super(authenticationSystemSupport, centralAuthenticationService, servicesManager,
            ticketRegistrySupport, warnCookieGenerator, authSelectionStrategies, selector);
    globalPrincipalAttributeValueRegex = casProperties.getAuthn().getMfa().getGlobalPrincipalAttributeValueRegex();
    attributeNames = commaDelimitedListToSet(casProperties.getAuthn().getMfa().getGlobalPrincipalAttributeNameTriggers());
}
项目:cas-5.1.0    文件:RegisteredServicePrincipalAttributeMultifactorAuthenticationPolicyEventResolver.java   
public RegisteredServicePrincipalAttributeMultifactorAuthenticationPolicyEventResolver(
        final AuthenticationSystemSupport authenticationSystemSupport, 
        final CentralAuthenticationService centralAuthenticationService,
        final ServicesManager servicesManager, 
        final TicketRegistrySupport ticketRegistrySupport,
        final CookieGenerator warnCookieGenerator, 
        final AuthenticationServiceSelectionPlan authenticationSelectionStrategies,
        final MultifactorAuthenticationProviderSelector selector) {
    super(authenticationSystemSupport, centralAuthenticationService, servicesManager, ticketRegistrySupport, warnCookieGenerator,
            authenticationSelectionStrategies, selector);
}
项目:cas-5.1.0    文件:PredicatedPrincipalAttributeMultifactorAuthenticationPolicyEventResolver.java   
public PredicatedPrincipalAttributeMultifactorAuthenticationPolicyEventResolver(final AuthenticationSystemSupport authenticationSystemSupport,
                                                                                final CentralAuthenticationService centralAuthenticationService,
                                                                                final ServicesManager servicesManager,
                                                                                final TicketRegistrySupport ticketRegistrySupport,
                                                                                final CookieGenerator warnCookieGenerator,
                                                                                final AuthenticationServiceSelectionPlan authSelectionStrategies,
                                                                                final MultifactorAuthenticationProviderSelector selector,
                                                                                final CasConfigurationProperties casProperties) {
    super(authenticationSystemSupport, centralAuthenticationService, servicesManager,
            ticketRegistrySupport, warnCookieGenerator, authSelectionStrategies, selector,
            casProperties);
    predicateResource = casProperties.getAuthn().getMfa().getGlobalPrincipalAttributePredicate();
}
项目:cas-5.1.0    文件:AuthenticationAttributeMultifactorAuthenticationPolicyEventResolver.java   
public AuthenticationAttributeMultifactorAuthenticationPolicyEventResolver(final AuthenticationSystemSupport authenticationSystemSupport,
                                                                           final CentralAuthenticationService centralAuthenticationService,
                                                                           final ServicesManager servicesManager,
                                                                           final TicketRegistrySupport ticketRegistrySupport,
                                                                           final CookieGenerator warnCookieGenerator,
                                                                           final AuthenticationServiceSelectionPlan selectionStrategies,
                                                                           final MultifactorAuthenticationProviderSelector selector,
                                                                           final CasConfigurationProperties casProperties) {
    super(authenticationSystemSupport, centralAuthenticationService, servicesManager,
            ticketRegistrySupport, warnCookieGenerator, selectionStrategies,
            selector);
    globalAuthenticationAttributeValueRegex = casProperties.getAuthn().getMfa().getGlobalAuthenticationAttributeValueRegex();
    attributeNames = commaDelimitedListToSet(casProperties.getAuthn().getMfa().getGlobalAuthenticationAttributeNameTriggers());
}
项目:cas-5.1.0    文件:RestEndpointMultifactorAuthenticationPolicyEventResolver.java   
public RestEndpointMultifactorAuthenticationPolicyEventResolver(final AuthenticationSystemSupport authenticationSystemSupport,
                                                                final CentralAuthenticationService centralAuthenticationService,
                                                                final ServicesManager servicesManager,
                                                                final TicketRegistrySupport ticketRegistrySupport,
                                                                final CookieGenerator warnCookieGenerator,
                                                                final AuthenticationServiceSelectionPlan authSelectionStrategies,
                                                                final MultifactorAuthenticationProviderSelector selector,
                                                                final CasConfigurationProperties casProperties) {
    super(authenticationSystemSupport, centralAuthenticationService, servicesManager,
            ticketRegistrySupport, warnCookieGenerator, authSelectionStrategies,
            selector);
    this.restEndpoint = casProperties.getAuthn().getMfa().getRestEndpoint();
}
项目:cas-5.1.0    文件:GlobalMultifactorAuthenticationPolicyEventResolver.java   
public GlobalMultifactorAuthenticationPolicyEventResolver(final AuthenticationSystemSupport authenticationSystemSupport,
                                                          final CentralAuthenticationService centralAuthenticationService,
                                                          final ServicesManager servicesManager,
                                                          final TicketRegistrySupport ticketRegistrySupport,
                                                          final CookieGenerator warnCookieGenerator,
                                                          final AuthenticationServiceSelectionPlan authenticationSelectionStrategies,
                                                          final MultifactorAuthenticationProviderSelector selector,
                                                          final CasConfigurationProperties casProperties) {
    super(authenticationSystemSupport, centralAuthenticationService, servicesManager,
            ticketRegistrySupport, warnCookieGenerator,
            authenticationSelectionStrategies, selector);
    globalProviderId = casProperties.getAuthn().getMfa().getGlobalProviderId();
}
项目:cas-5.1.0    文件:GroovyScriptMultifactorAuthenticationPolicyEventResolver.java   
public GroovyScriptMultifactorAuthenticationPolicyEventResolver(final AuthenticationSystemSupport authenticationSystemSupport,
                                                                final CentralAuthenticationService centralAuthenticationService,
                                                                final ServicesManager servicesManager,
                                                                final TicketRegistrySupport ticketRegistrySupport,
                                                                final CookieGenerator warnCookieGenerator,
                                                                final AuthenticationServiceSelectionPlan authenticationSelectionStrategies,
                                                                final MultifactorAuthenticationProviderSelector selector,
                                                                final CasConfigurationProperties casProperties) {
    super(authenticationSystemSupport, centralAuthenticationService, servicesManager,
            ticketRegistrySupport, warnCookieGenerator,
            authenticationSelectionStrategies, selector);
    groovyScript = casProperties.getAuthn().getMfa().getGroovyScript();
}
项目:cas-5.1.0    文件:RequestParameterMultifactorAuthenticationPolicyEventResolver.java   
public RequestParameterMultifactorAuthenticationPolicyEventResolver(final AuthenticationSystemSupport authenticationSystemSupport,
                                                                    final CentralAuthenticationService centralAuthenticationService,
                                                                    final ServicesManager servicesManager,
                                                                    final TicketRegistrySupport ticketRegistrySupport,
                                                                    final CookieGenerator warnCookieGenerator,
                                                                    final AuthenticationServiceSelectionPlan authenticationStrategies,
                                                                    final MultifactorAuthenticationProviderSelector selector,
                                                                    final CasConfigurationProperties casProperties) {
    super(authenticationSystemSupport, centralAuthenticationService, servicesManager,
            ticketRegistrySupport, warnCookieGenerator, authenticationStrategies, selector);
    mfaRequestParameter = casProperties.getAuthn().getMfa().getRequestParameter();
}
项目:cas-5.1.0    文件:RegisteredServiceMultifactorAuthenticationPolicyEventResolver.java   
public RegisteredServiceMultifactorAuthenticationPolicyEventResolver(final AuthenticationSystemSupport authenticationSystemSupport,
                                                                     final CentralAuthenticationService centralAuthenticationService,
                                                                     final ServicesManager servicesManager,
                                                                     final TicketRegistrySupport ticketRegistrySupport,
                                                                     final CookieGenerator warnCookieGenerator,
                                                                     final AuthenticationServiceSelectionPlan authSelectionStrategies,
                                                                     final MultifactorAuthenticationProviderSelector selector) {
    super(authenticationSystemSupport, centralAuthenticationService, servicesManager,
            ticketRegistrySupport, warnCookieGenerator, authSelectionStrategies, selector);
}
项目:cas-5.1.0    文件:InitialAuthenticationAttemptWebflowEventResolver.java   
public InitialAuthenticationAttemptWebflowEventResolver(final AuthenticationSystemSupport authenticationSystemSupport,
                                                        final CentralAuthenticationService centralAuthenticationService,
                                                        final ServicesManager servicesManager,
                                                        final TicketRegistrySupport ticketRegistrySupport,
                                                        final CookieGenerator warnCookieGenerator,
                                                        final AuthenticationServiceSelectionPlan authenticationSelectionStrategies,
                                                        final MultifactorAuthenticationProviderSelector selector) {
    super(authenticationSystemSupport, centralAuthenticationService,
            servicesManager, ticketRegistrySupport, warnCookieGenerator,
            authenticationSelectionStrategies, selector);
}
项目:cas-5.1.0    文件:ServiceTicketRequestWebflowEventResolver.java   
public ServiceTicketRequestWebflowEventResolver(final AuthenticationSystemSupport authenticationSystemSupport,
                                                final CentralAuthenticationService centralAuthenticationService, final ServicesManager servicesManager,
                                                final TicketRegistrySupport ticketRegistrySupport, final CookieGenerator warnCookieGenerator,
                                                final AuthenticationServiceSelectionPlan authenticationSelectionStrategies,
                                                final MultifactorAuthenticationProviderSelector selector) {
    super(authenticationSystemSupport, centralAuthenticationService, servicesManager, ticketRegistrySupport, warnCookieGenerator,
            authenticationSelectionStrategies, selector);
}
项目:cas-5.1.0    文件:AdaptiveMultifactorAuthenticationPolicyEventResolver.java   
public AdaptiveMultifactorAuthenticationPolicyEventResolver(final AuthenticationSystemSupport authenticationSystemSupport,
                                                            final CentralAuthenticationService centralAuthenticationService,
                                                            final ServicesManager servicesManager, final TicketRegistrySupport ticketRegistrySupport,
                                                            final CookieGenerator warnCookieGenerator,
                                                            final AuthenticationServiceSelectionPlan authenticationSelectionStrategies,
                                                            final MultifactorAuthenticationProviderSelector selector,
                                                            final CasConfigurationProperties casProperties, final GeoLocationService geoLocationService) {
    super(authenticationSystemSupport, centralAuthenticationService, servicesManager, ticketRegistrySupport, warnCookieGenerator,
            authenticationSelectionStrategies, selector);
    multifactorMap = casProperties.getAuthn().getAdaptive().getRequireMultifactor();
    this.geoLocationService = geoLocationService;
}
项目:cas-5.1.0    文件:NoOpCasWebflowEventResolver.java   
public NoOpCasWebflowEventResolver(final AuthenticationSystemSupport authenticationSystemSupport,
                                   final CentralAuthenticationService centralAuthenticationService, final ServicesManager servicesManager,
                                   final TicketRegistrySupport ticketRegistrySupport, final CookieGenerator warnCookieGenerator,
                                   final AuthenticationServiceSelectionPlan authenticationSelectionStrategies,
                                   final MultifactorAuthenticationProviderSelector selector) {
    super(authenticationSystemSupport, centralAuthenticationService, servicesManager, ticketRegistrySupport, warnCookieGenerator,
            authenticationSelectionStrategies, selector);
}
项目:cas-5.1.0    文件:RankedAuthenticationProviderWebflowEventResolver.java   
public RankedAuthenticationProviderWebflowEventResolver(final AuthenticationSystemSupport authenticationSystemSupport,
                                                        final CentralAuthenticationService centralAuthenticationService,
                                                        final ServicesManager servicesManager,
                                                        final TicketRegistrySupport ticketRegistrySupport,
                                                        final CookieGenerator warnCookieGenerator,
                                                        final AuthenticationServiceSelectionPlan authenticationSelectionStrategies,
                                                        final MultifactorAuthenticationProviderSelector selector,
                                                        final AuthenticationContextValidator authenticationContextValidator,
                                                        final CasDelegatingWebflowEventResolver casDelegatingWebflowEventResolver) {
    super(authenticationSystemSupport, centralAuthenticationService, servicesManager, ticketRegistrySupport, warnCookieGenerator,
            authenticationSelectionStrategies, selector);
    this.authenticationContextValidator = authenticationContextValidator;
    this.initialAuthenticationAttemptWebflowEventResolver = casDelegatingWebflowEventResolver;
}
项目:cas-5.1.0    文件:SelectiveAuthenticationProviderWebflowEventEventResolver.java   
public SelectiveAuthenticationProviderWebflowEventEventResolver(final AuthenticationSystemSupport authenticationSystemSupport,
                                                                final CentralAuthenticationService centralAuthenticationService,
                                                                final ServicesManager servicesManager,
                                                                final TicketRegistrySupport ticketRegistrySupport,
                                                                final CookieGenerator warnCookieGenerator,
                                                                final AuthenticationServiceSelectionPlan authenticationSelectionStrategies,
                                                                final MultifactorAuthenticationProviderSelector selector) {
    super(authenticationSystemSupport, centralAuthenticationService, servicesManager, ticketRegistrySupport, warnCookieGenerator,
            authenticationSelectionStrategies, selector);
}
项目:cas-5.1.0    文件:AbstractCasWebflowEventResolver.java   
public AbstractCasWebflowEventResolver(final AuthenticationSystemSupport authenticationSystemSupport,
                                       final CentralAuthenticationService centralAuthenticationService, final ServicesManager servicesManager,
                                       final TicketRegistrySupport ticketRegistrySupport, final CookieGenerator warnCookieGenerator,
                                       final AuthenticationServiceSelectionPlan authenticationSelectionStrategies,
                                       final MultifactorAuthenticationProviderSelector selector) {
    this.authenticationSystemSupport = authenticationSystemSupport;
    this.centralAuthenticationService = centralAuthenticationService;
    this.servicesManager = servicesManager;
    this.ticketRegistrySupport = ticketRegistrySupport;
    this.warnCookieGenerator = warnCookieGenerator;
    authenticationRequestServiceSelectionStrategies = authenticationSelectionStrategies;
    multifactorAuthenticationProviderSelector = selector;
}
项目:cas-5.1.0    文件:WebUtils.java   
/**
 * Put warn cookie if request parameter present.
 *
 * @param warnCookieGenerator the warn cookie generator
 * @param context             the context
 */
public static void putWarnCookieIfRequestParameterPresent(final CookieGenerator warnCookieGenerator, final RequestContext context) {
    if (warnCookieGenerator != null) {
        LOGGER.debug("Evaluating request to determine if warning cookie should be generated");
        final HttpServletResponse response = WebUtils.getHttpServletResponse(context);
        if (StringUtils.isNotBlank(context.getExternalContext().getRequestParameterMap().get("warn"))) {
            warnCookieGenerator.addCookie(response, "true");
        }
    } else {
        LOGGER.debug("No warning cookie generator is defined");
    }
}
项目:session-to-cookie    文件:SessionToCookieFilter.java   
/**
 * checks if a session with data exists and puts all its data into a session data cookie which is added to the response.  
 * 
 * @param httpServletRequest
 * @param httpServletResponse
 * @throws IOException
 */
protected void addCookieToResponseIfSessionDataExists(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse)
        throws IOException {
    if (sessionExists(httpServletRequest)) {
        LOG.debug("OUT: session exists.");
        Map<String, Object> sessionData = retrieveSessionDataFromSession(httpServletRequest.getSession(false));
        if (!sessionData.isEmpty()) {
            LOG.debug("OUT: sessiondata exists: " + sessionData);
            byte[] cookiePayload = getCookiePayload(sessionData);
            CookieGenerator cookieGenerator = getSessionDataCookieGenerator();
            LOG.debug("OUT: will add session data cookie to response. value: " + new String(cookiePayload));
            cookieGenerator.addCookie(httpServletResponse, new String(cookiePayload));
        }
    }
}
项目:session-to-cookie    文件:SessionToCookieFilter.java   
/**
 * if you need to customize the cookie (timeout, http-only and so on), you
 * may overwrite this. It makes sense to make this cookie a session cookie
 * btw, since it contains session information :)
 * 
 * @param cookieGenerator
 */
protected void customizeSessionDataCookie(CookieGenerator cookieGenerator) {
    cookieGenerator.setCookieName(SESSIONDATACOOKIENAME);
    // since the cookie contains encrypted data, it is not supposed to be
    // read by scripts.
    cookieGenerator.setCookieHttpOnly(true);
    // set this cookie to be a session cookie. If you think you need more
    // here, rather use proper cookies for persisting things to the client.
    cookieGenerator.setCookieMaxAge(-1);
    // this kind of cookies should be on a https endpoint...
    // TODO: think on how we could make sure this is enabled for production, maybe use profiles?
    // cookieGenerator.setCookieSecure(true);
}
项目:cas4.0.x-server-wechat    文件:AuthenticationViaFormActionTests.java   
@Before
   public void onSetUp() throws Exception {
       this.action = new AuthenticationViaFormAction();

       this.warnCookieGenerator = new CookieGenerator();
       this.warnCookieGenerator.setCookieName("WARN");
       this.warnCookieGenerator.setCookieName("TGT");
       this.warnCookieGenerator.setCookieDomain("/");
       this.warnCookieGenerator.setCookiePath("/");

       this.action
           .setCentralAuthenticationService(getCentralAuthenticationService());
       this.action.setWarnCookieGenerator(this.warnCookieGenerator);
//       this.action.afterPropertiesSet();
   }
项目:cas-server-4.2.1    文件:AuthenticationViaFormActionTests.java   
@Before
public void onSetUp() throws Exception {
    this.action = new AuthenticationViaFormAction();

    this.warnCookieGenerator = new CookieGenerator();
    this.warnCookieGenerator.setCookieName("WARN");
    this.warnCookieGenerator.setCookieName("TGT");
    this.warnCookieGenerator.setCookieDomain("/");
    this.warnCookieGenerator.setCookiePath("/");

    this.action.setCentralAuthenticationService(getCentralAuthenticationService());
    this.action.setAuthenticationSystemSupport(getAuthenticationSystemSupport());
    this.action.setWarnCookieGenerator(this.warnCookieGenerator);
}
项目:cas-server-4.2.1    文件:WebUtils.java   
/**
 * Put warn cookie if request parameter present.
 *
 * @param warnCookieGenerator the warn cookie generator
 * @param context             the context
 */
public static void putWarnCookieIfRequestParameterPresent(final CookieGenerator warnCookieGenerator, final RequestContext context) {
    if (warnCookieGenerator != null) {
        LOGGER.debug("Evaluating request to determine if warning cookie should be generated");
        final HttpServletResponse response = WebUtils.getHttpServletResponse(context);
        if (StringUtils.isNotBlank(context.getExternalContext().getRequestParameterMap().get("warn"))) {
            warnCookieGenerator.addCookie(response, "true");
        } else {
            warnCookieGenerator.removeCookie(response);
        }
    } else {
        LOGGER.debug("No warning cookie generator is defined");
    }
}
项目:cas4.1.9    文件:AuthenticationViaFormActionTests.java   
@Before
public void onSetUp() throws Exception {
    this.action = new AuthenticationViaFormAction();

    this.warnCookieGenerator = new CookieGenerator();
    this.warnCookieGenerator.setCookieName("WARN");
    this.warnCookieGenerator.setCookieName("TGT");
    this.warnCookieGenerator.setCookieDomain("/");
    this.warnCookieGenerator.setCookiePath("/");

    this.action.setCentralAuthenticationService(getCentralAuthenticationService());
    this.action.setWarnCookieGenerator(this.warnCookieGenerator);
}
项目:cas-4.0.1    文件:AuthenticationViaFormActionTests.java   
@Before
   public void onSetUp() throws Exception {
       this.action = new AuthenticationViaFormAction();

       this.warnCookieGenerator = new CookieGenerator();
       this.warnCookieGenerator.setCookieName("WARN");
       this.warnCookieGenerator.setCookieName("TGT");
       this.warnCookieGenerator.setCookieDomain("/");
       this.warnCookieGenerator.setCookiePath("/");

       this.action
           .setCentralAuthenticationService(getCentralAuthenticationService());
       this.action.setWarnCookieGenerator(this.warnCookieGenerator);
//       this.action.afterPropertiesSet();
   }
项目:p00    文件:AuthenticationViaFormActionTests.java   
@Before
   public void onSetUp() throws Exception {
       this.action = new AuthenticationViaFormAction();

       this.warnCookieGenerator = new CookieGenerator();
       this.warnCookieGenerator.setCookieName("WARN");
       this.warnCookieGenerator.setCookieName("TGT");
       this.warnCookieGenerator.setCookieDomain("/");
       this.warnCookieGenerator.setCookiePath("/");

       this.action
           .setCentralAuthenticationService(getCentralAuthenticationService());
       this.action.setWarnCookieGenerator(this.warnCookieGenerator);
//       this.action.afterPropertiesSet();
   }