Tabnine Logo
AbstractTicketValidationFilter
Code IndexAdd Tabnine to your IDE (free)

How to use
AbstractTicketValidationFilter
in
org.jasig.cas.client.validation

Best Java code snippets using org.jasig.cas.client.validation.AbstractTicketValidationFilter (Showing top 12 results out of 315)

origin: org.jasig.cas/com.springsource.org.jasig.cas.client

protected void initInternal(final FilterConfig filterConfig) throws ServletException {
  setExceptionOnValidationFailure(parseBoolean(getPropertyFromInitParams(filterConfig, "exceptionOnValidationFailure", "true")));
  log.trace("Setting exceptionOnValidationFailure parameter: " + this.exceptionOnValidationFailure);
  setRedirectAfterValidation(parseBoolean(getPropertyFromInitParams(filterConfig, "redirectAfterValidation", "true")));
  log.trace("Setting redirectAfterValidation parameter: " + this.redirectAfterValidation);
  setUseSession(parseBoolean(getPropertyFromInitParams(filterConfig, "useSession", "true")));
  log.trace("Setting useSession parameter: " + this.useSession);
  setTicketValidator(getTicketValidator(filterConfig));
  super.initInternal(filterConfig);
}
origin: apereo/java-cas-client

public void destroy() {
  super.destroy();
  this.timer.cancel();
}
origin: apereo/java-cas-client

protected void initInternal(final FilterConfig filterConfig) throws ServletException {
  setExceptionOnValidationFailure(getBoolean(ConfigurationKeys.EXCEPTION_ON_VALIDATION_FAILURE));
  setRedirectAfterValidation(getBoolean(ConfigurationKeys.REDIRECT_AFTER_VALIDATION));
  setUseSession(getBoolean(ConfigurationKeys.USE_SESSION));
  if (!this.useSession && this.redirectAfterValidation) {
    logger.warn("redirectAfterValidation parameter may not be true when useSession parameter is false. Resetting it to false in order to prevent infinite redirects.");
    setRedirectAfterValidation(false);
  }
  setTicketValidator(getTicketValidator(filterConfig));
  super.initInternal(filterConfig);
}
origin: org.jasig.cas/com.springsource.org.jasig.cas.client

public final void doFilter(final ServletRequest servletRequest, final ServletResponse servletResponse, final FilterChain filterChain) throws IOException, ServletException {
  if (!preFilter(servletRequest, servletResponse, filterChain)) {
    return;
  final String ticket = CommonUtils.safeGetParameter(request, getArtifactParameterName());
      final Assertion assertion = this.ticketValidator.validate(ticket, constructServiceUrl(request, response));
        request.getSession().setAttribute(CONST_CAS_ASSERTION, assertion);
      onSuccessfulValidation(request, response, assertion);
        response.sendRedirect(constructServiceUrl(request, response));
        return;
      log.warn(e, e);
      onFailedValidation(request, response);
origin: apereo/java-cas-client

public final void doFilter(final ServletRequest servletRequest, final ServletResponse servletResponse,
    final FilterChain filterChain) throws IOException, ServletException {
  if (!preFilter(servletRequest, servletResponse, filterChain)) {
    return;
  final String ticket = retrieveTicketFromRequest(request);
          constructServiceUrl(request, response));
        request.getSession().setAttribute(CONST_CAS_ASSERTION, assertion);
      onSuccessfulValidation(request, response, assertion);
        response.sendRedirect(constructServiceUrl(request, response));
        return;
      logger.debug(e.getMessage(), e);
      onFailedValidation(request, response);
origin: org.jasig.cas/com.springsource.org.jasig.cas.client

protected void initInternal(final FilterConfig filterConfig) throws ServletException {
  super.initInternal(filterConfig);
  log.warn("SAML1.1 compliance requires the [artifactParameterName] and [serviceParameterName] to be set to specified values.");
  log.warn("This filter will overwrite any user-provided values (if any are provided)");
  setArtifactParameterName("SAMLart");
  setServiceParameterName("TARGET");
}
origin: stackoverflow.com

 @Bean
FilterRegistrationBean ticketValidationFilter(){

  AbstractTicketValidationFilter ticketValidationFilter = new
      org.jasig.cas.client.validation.Cas20ProxyReceivingTicketValidationFilter();

  FilterRegistrationBean frb = new FilterRegistrationBean();
  frb.addUrlPatterns("/*");
  frb.setFilter(ticketValidationFilter);

  //here be ticket validaror

  TicketValidator validator = new org.jasig.cas.client.validation.Cas20ServiceTicketValidator("https://localhost:8443/cas");

  ticketValidationFilter.setTicketValidator(validator);

  //end of ticket validator config

  Map<String, String> initParamMap = new HashMap<String, String>();
  initParamMap.put("service", "http://localhost:8889/cas-client");
  frb.setInitParameters(initParamMap);

  return frb;
}
origin: apereo/java-cas-client

public void init() {
  super.init();
  CommonUtils.assertNotNull(this.proxyGrantingTicketStorage, "proxyGrantingTicketStorage cannot be null.");
  if (this.timer == null) {
    this.timer = new Timer(true);
  }
  if (this.timerTask == null) {
    this.timerTask = new CleanUpTimerTask(this.proxyGrantingTicketStorage);
  }
  this.timer.schedule(this.timerTask, this.millisBetweenCleanUps, this.millisBetweenCleanUps);
}
origin: org.jasig.cas/com.springsource.org.jasig.cas.client

protected void initInternal(final FilterConfig filterConfig) throws ServletException {
  setProxyReceptorUrl(getPropertyFromInitParams(filterConfig, "proxyReceptorUrl", null));
  final String proxyGrantingTicketStorageClass = getPropertyFromInitParams(filterConfig, "proxyGrantingTicketStorageClass", null);
  if (proxyGrantingTicketStorageClass != null) {
    try {
      final Class storageClass = Class.forName(proxyGrantingTicketStorageClass);
      this.proxyGrantingTicketStorage = (ProxyGrantingTicketStorage) storageClass.newInstance();
    } catch (final Exception e) {
      throw new RuntimeException(e);
    }
  }
  log.trace("Setting proxyReceptorUrl parameter: " + this.proxyReceptorUrl);
  this.millisBetweenCleanUps = Integer.parseInt(getPropertyFromInitParams(filterConfig, "millisBetweenCleanUps", Integer.toString(DEFAULT_MILLIS_BETWEEN_CLEANUPS)));
  super.initInternal(filterConfig);
}
origin: org.jasig.cas/com.springsource.org.jasig.cas.client

public void init() {
  super.init();
  CommonUtils.assertNotNull(this.proxyGrantingTicketStorage, "proxyGrantingTicketStorage cannot be null.");
  if (this.timer == null) {
    this.timer = new Timer(true);
  }
  if (this.timerTask == null) {
    this.timerTask = new CleanUpTimerTask(this.proxyGrantingTicketStorage);
  }
  this.timer.schedule(this.timerTask, this.millisBetweenCleanUps, this.millisBetweenCleanUps);
}
origin: apereo/java-cas-client

protected void initInternal(final FilterConfig filterConfig) throws ServletException {
  setProxyReceptorUrl(getString(ConfigurationKeys.PROXY_RECEPTOR_URL));
  final Class<? extends ProxyGrantingTicketStorage> proxyGrantingTicketStorageClass = getClass(ConfigurationKeys.PROXY_GRANTING_TICKET_STORAGE_CLASS);
  if (proxyGrantingTicketStorageClass != null) {
    this.proxyGrantingTicketStorage = ReflectUtils.newInstance(proxyGrantingTicketStorageClass);
    if (this.proxyGrantingTicketStorage instanceof AbstractEncryptedProxyGrantingTicketStorageImpl) {
      final AbstractEncryptedProxyGrantingTicketStorageImpl p = (AbstractEncryptedProxyGrantingTicketStorageImpl) this.proxyGrantingTicketStorage;
      final String cipherAlgorithm = getString(ConfigurationKeys.CIPHER_ALGORITHM);
      final String secretKey = getString(ConfigurationKeys.SECRET_KEY);
      p.setCipherAlgorithm(cipherAlgorithm);
      try {
        if (secretKey != null) {
          p.setSecretKey(secretKey);
        }
      } catch (final Exception e) {
        throw new RuntimeException(e);
      }
    }
  }
  this.millisBetweenCleanUps = getInt(ConfigurationKeys.MILLIS_BETWEEN_CLEAN_UPS);
  super.initInternal(filterConfig);
}
origin: org.jasig.cas/com.springsource.org.jasig.cas.client

public void destroy() {
  super.destroy();
  this.timer.cancel();
}
org.jasig.cas.client.validationAbstractTicketValidationFilter

Javadoc

The filter that handles all the work of validating ticket requests.

This filter can be configured with the following values:

  • redirectAfterValidation - redirect the CAS client to the same URL without the ticket. (default: true, Will be forced to false when #useSession is false.)
  • exceptionOnValidationFailure - throw an exception if the validation fails. Otherwise, continue processing. (default: true)
  • useSession - store any of the useful information in a session attribute. (default: true)
  • hostnameVerifier - name of class implementing a HostnameVerifier.
  • hostnameVerifierConfig - name of configuration class (constructor argument of verifier).

Most used methods

  • setTicketValidator
  • constructServiceUrl
  • destroy
  • getTicketValidator
    Template method to return the appropriate validator.
  • init
  • initInternal
  • onFailedValidation
    Template method that gets executed if validation fails. This method is called right after the except
  • onSuccessfulValidation
    Template method that gets executed if ticket validation succeeds. Override if you want additional be
  • preFilter
    Pre-process the request before the normal filter process starts. This could be useful for pre-emptin
  • setExceptionOnValidationFailure
  • setRedirectAfterValidation
  • setUseSession
  • setRedirectAfterValidation,
  • setUseSession,
  • getArtifactParameterName,
  • getBoolean,
  • getClass,
  • getPropertyFromInitParams,
  • getString,
  • parseBoolean,
  • retrieveTicketFromRequest

Popular in Java

  • Start an intent from android
  • getResourceAsStream (ClassLoader)
  • compareTo (BigDecimal)
  • findViewById (Activity)
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now