Пример #1
0
  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(
        "------------------------------------------------------------------------------------");

    String principal = assertion.getPrincipal().getName();
    this.saveSSOCredentials(principal, httpRequest);
  }