Package org.jasig.cas.client.validation

Examples of org.jasig.cas.client.validation.Cas20ProxyTicketValidator


    this.renewTicket = renewTicket;
  }

  public void validateTicket(HttpServletRequest httpRequest, String ticket) throws Exception
  {   
    Cas20ProxyTicketValidator ticketValidator = new Cas20ProxyTicketValidator(casServerUrl);
      ticketValidator.setRenew(this.renewTicket);
     
      //String serviceUrl = "http://"+ httpRequest.getServerName() +":" + httpRequest.getServerPort() +
      //httpRequest.getContextPath() +"/private/classic";
      Assertion assertion = ticketValidator.validate(ticket, this.casServiceUrl);
     
      log.debug("------------------------------------------------------------------------------------");
      log.debug("Service: "+this.casServiceUrl);
      log.debug("Principal: "+assertion.getPrincipal().getName());
      log.debug("------------------------------------------------------------------------------------");
View Full Code Here


                cas20ServiceTicketValidator.setProxyCallbackUrl(this.casProxyReceptor.getCallbackUrl());
                cas20ServiceTicketValidator.setProxyGrantingTicketStorage(this.casProxyReceptor
                        .getProxyGrantingTicketStorage());
            }
        } else if (this.casProtocol == CasProtocol.CAS20_PROXY) {
            this.ticketValidator = new Cas20ProxyTicketValidator(this.casPrefixUrl);
            final Cas20ProxyTicketValidator cas20ProxyTicketValidator = (Cas20ProxyTicketValidator) this.ticketValidator;
            cas20ProxyTicketValidator.setAcceptAnyProxy(this.acceptAnyProxy);
            cas20ProxyTicketValidator.setAllowedProxyChains(this.allowedProxyChains);
            if (this.casProxyReceptor != null) {
                cas20ProxyTicketValidator.setProxyCallbackUrl(this.casProxyReceptor.getCallbackUrl());
                cas20ProxyTicketValidator.setProxyGrantingTicketStorage(this.casProxyReceptor
                        .getProxyGrantingTicketStorage());
            }
        } else if (this.casProtocol == CasProtocol.SAML) {
          Saml11TicketValidator saml11TicketValidator=new Saml11TicketValidator(this.casPrefixUrl);
          saml11TicketValidator.setTolerance(getTimeTolerance());
View Full Code Here

      logger.debug("Read validateService=" + validateService);
  }
  logger.debug("userId:"+userId);
  try {
    AttributePrincipal principal = null;
    Cas20ProxyTicketValidator sv = new Cas20ProxyTicketValidator(validateUrl);
    sv.setAcceptAnyProxy(true);

      Assertion a = sv.validate(ticket, validateService);
    principal = a.getPrincipal();
    logger.debug("Ticket is VALID, username=" + principal.getName());
     
  } catch (TicketValidationException e) {
    logger.error("An exception occured while validating the cas token");
View Full Code Here

    this.renewTicket = renewTicket;
  }

  public void validateTicket(HttpServletRequest httpRequest, String ticket) throws Exception
  {   
    Cas20ProxyTicketValidator ticketValidator = new Cas20ProxyTicketValidator(casServerUrl);
      ticketValidator.setRenew(this.renewTicket);
     
      //String serviceUrl = "http://"+ httpRequest.getServerName() +":" + httpRequest.getServerPort() +
      //httpRequest.getContextPath() +"/private/classic";
      Assertion assertion = ticketValidator.validate(ticket, this.casServiceUrl);
     
      log.debug("------------------------------------------------------------------------------------");
      log.debug("Service: "+this.casServiceUrl);
      log.debug("Principal: "+assertion.getPrincipal().getName());
      log.debug("------------------------------------------------------------------------------------");
View Full Code Here

    this.renewTicket = renewTicket;
  }

  public void validateTicket(HttpServletRequest httpRequest, String ticket) throws Exception
  {   
    Cas20ProxyTicketValidator ticketValidator = new Cas20ProxyTicketValidator(casServerUrl);
    ticketValidator.setRenew(this.renewTicket);
   
    String serviceUrl = "http://"+ httpRequest.getServerName() +":" + httpRequest.getServerPort() +
    httpRequest.getContextPath() +"/private/classic";
    Assertion assertion = ticketValidator.validate(ticket, serviceUrl);
   
    log.debug("------------------------------------------------------------------------------------");
    log.debug("Service: "+serviceUrl);
    log.debug("Principal: "+assertion.getPrincipal().getName());
    log.debug("------------------------------------------------------------------------------------");
View Full Code Here

        return NAME;
    }

    protected void startInternal() throws LifecycleException {
        super.startInternal();
        this.ticketValidator = new Cas20ProxyTicketValidator(getCasServerUrlPrefix());
        this.ticketValidator.setRenew(isRenew());
        this.ticketValidator.setProxyCallbackUrl(getProxyCallbackUrl());
        this.ticketValidator.setProxyGrantingTicketStorage(ProxyCallbackValve.getProxyGrantingTicketStorage());
        this.ticketValidator.setAcceptAnyProxy(this.acceptAnyProxy);
        this.ticketValidator.setAllowedProxyChains(CommonUtils.createProxyList(this.allowedProxyChains));
View Full Code Here

        return NAME;
    }

    public void start() throws LifecycleException {
        super.start();
        this.ticketValidator = new Cas20ProxyTicketValidator(getCasServerUrlPrefix());
        this.ticketValidator.setRenew(isRenew());
        this.ticketValidator.setProxyCallbackUrl(getProxyCallbackUrl());
        this.ticketValidator.setProxyGrantingTicketStorage(ProxyCallbackValve.getProxyGrantingTicketStorage());
        this.ticketValidator.setAcceptAnyProxy(this.acceptAnyProxy);
        this.ticketValidator.setAllowedProxyChains(CommonUtils.createProxyList(this.allowedProxyChains));
View Full Code Here

    protected Assertion authenticateWithPGT(CasFormAuthenticationHelper helper) throws Exception {
        helper.ssoLogin();

        String ticket = helper.getServiceTicket(serviceUrl);

        Cas20ProxyTicketValidator validator = new Cas20ProxyTicketValidator(
                casServerURLPrefix.toString());
        validator.setAcceptAnyProxy(true);
        validator.setProxyCallbackUrl(GeoServerCasConstants
                .createProxyCallBackURl(proxyCallbackUrlPrefix.toExternalForm()));
        validator.setProxyGrantingTicketStorage(GeoServerExtensions
                .bean(ProxyGrantingTicketStorage.class));

        Assertion result = validator.validate(ticket, serviceUrl.toExternalForm());

        assertNotNull(result);
        return result;

    }
View Full Code Here

TOP

Related Classes of org.jasig.cas.client.validation.Cas20ProxyTicketValidator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.