报错:No principal was found in the response from the CAS server


在做cas单点登陆时数据库连接配置没问题,用户信息也没问题,客户端也配置好了,单点登陆可以正常登录,就是跳回客户端时在Cas20ServiceTicketValidator这个类的下面的方法里报出错来,
 protected final Assertion parseResponseFromServer(final String response) throws TicketValidationException {
        final String error = XmlUtils.getTextForElement(response, "authenticationFailure");

        if (CommonUtils.isNotBlank(error)) {
            throw new TicketValidationException(error);
        }

        final String principal = XmlUtils.getTextForElement(response, "user");
        final String proxyGrantingTicketIou = XmlUtils.getTextForElement(response, "proxyGrantingTicket");

        final String proxyGrantingTicket;
        if (CommonUtils.isBlank(proxyGrantingTicketIou) || this.proxyGrantingTicketStorage == null) {
            proxyGrantingTicket = null;
        } else {
            proxyGrantingTicket = this.proxyGrantingTicketStorage.retrieve(proxyGrantingTicketIou);
        }

        if (CommonUtils.isEmpty(principal)) {
            throw new TicketValidationException("No principal was found in the response from the CAS server.");
        }
分析后发现是response返回值出问题了,



  
    
    CAS – Central Authentication Service
    
        
    
    


 
       

Central Authentication Service (CAS)

 
 
        
                                                                       
                   

HTTPS and IMAPS

                   

This service definition authorized all application urls that support HTTPS and IMAPS protocols.

               
   
   

   
       

Enter your Username and Password

       
                                                                                                                             
       
                                                                    
       

你可能感兴趣的:(报错:No principal was found in the response from the CAS server)