Cas第一次登陆总失败

kenzhucx 发布于 2016/11/22 14:28
阅读 2K+
收藏 0

项目使用spring + spring mvc, cas验证登陆,有一个很奇怪的问题,隔一段时间(两三天)之后重新登陆,第一次登陆总会失败,第二次开始就没有问题。

下面是登陆信息, 第一次登陆,PolicyBasedAuthenticationManager没有激活,账号密码都正确

------------------------------------------------------------------


2016-11-21 14:19:29,947 INFO [org.jasig.cas.services.DefaultServicesManagerImpl] - <Reloading registered services.>
2016-11-21 14:19:29,947 INFO [org.jasig.cas.services.DefaultServicesManagerImpl] - <Loaded 1 services.>
2016-11-21 14:20:01,302 INFO [org.jasig.cas.adaptors.jdbc.QueryDatabaseAuthenticationHandler] - <Login username: defaultus>
2016-11-21 14:20:01,302 INFO [org.jasig.cas.adaptors.jdbc.QueryDatabaseAuthenticationHandler] - <Login password: abc123>
2016-11-21 14:20:01,302 INFO [org.jasig.cas.adaptors.jdbc.QueryDatabaseAuthenticationHandler] - <Encrypted Password: e99a18c428cb38d5f260853678922e03>
2016-11-21 14:20:01,312 INFO [com.github.inspektr.audit.support.Slf4jLoggingAuditTrailManager] - <Audit trail record BEGIN
=============================================================
WHO: audit:unknown
WHAT: supplied credentials: [defaultus+password]
ACTION: AUTHENTICATION_FAILED
APPLICATION: CAS
WHEN: Mon Nov 21 14:20:01 CST 2016
CLIENT IP ADDRESS: 10.87.61.79
SERVER IP ADDRESS: 10.87.60.85
=============================================================

>
2016-11-21 14:20:01,313 INFO [com.github.inspektr.audit.support.Slf4jLoggingAuditTrailManager] - <Audit trail record BEGIN
=============================================================
WHO: audit:unknown
WHAT: 1 errors, 0 successes
ACTION: TICKET_GRANTING_TICKET_NOT_CREATED
APPLICATION: CAS
WHEN: Mon Nov 21 14:20:01 CST 2016
CLIENT IP ADDRESS: 10.87.61.79
SERVER IP ADDRESS: 10.87.60.85
=============================================================

>
2016-11-21 14:21:29,947 INFO [org.jasig.cas.services.DefaultServicesManagerImpl] - <Reloading registered services.>
2016-11-21 14:21:29,955 INFO [org.jasig.cas.services.DefaultServicesManagerImpl] - <Loaded 1 services.>
2016-11-21 14:22:03,762 INFO [org.jasig.cas.adaptors.jdbc.QueryDatabaseAuthenticationHandler] - <Login username: defaultus>
2016-11-21 14:22:03,762 INFO [org.jasig.cas.adaptors.jdbc.QueryDatabaseAuthenticationHandler] - <Login password: abc123>
2016-11-21 14:22:03,762 INFO [org.jasig.cas.adaptors.jdbc.QueryDatabaseAuthenticationHandler] - <Encrypted Password: e99a18c428cb38d5f260853678922e03>
2016-11-21 14:22:03,772 INFO [org.jasig.cas.authentication.PolicyBasedAuthenticationManager] - <QueryDatabaseAuthenticationHandler successfully authenticated defaultus+password>
2016-11-21 14:22:03,772 INFO [org.jasig.cas.authentication.PolicyBasedAuthenticationManager] - <Authenticated defaultus with credentials [defaultus+password].>
2016-11-21 14:22:03,773 INFO [com.github.inspektr.audit.support.Slf4jLoggingAuditTrailManager] - <Audit trail record BEGIN
=============================================================
WHO: audit:unknown
WHAT: supplied credentials: [defaultus+password]
ACTION: AUTHENTICATION_SUCCESS
APPLICATION: CAS
WHEN: Mon Nov 21 14:22:03 CST 2016
CLIENT IP ADDRESS: 10.87.61.79
SERVER IP ADDRESS: 10.87.60.85
=============================================================

>
2016-11-21 14:22:03,773 INFO [com.github.inspektr.audit.support.Slf4jLoggingAuditTrailManager] - <Audit trail record BEGIN
=============================================================
WHO: audit:unknown
WHAT: TGT-3-oJ45LALB2GLw7z5Ycnljk1IBjHhBaapWjGmiQ3gYS0JnqtPBSQ-cas01.example.org
ACTION: TICKET_GRANTING_TICKET_CREATED
APPLICATION: CAS
WHEN: Mon Nov 21 14:22:03 CST 2016
CLIENT IP ADDRESS: 10.87.61.79
SERVER IP ADDRESS: 10.87.60.85
=============================================================

>
2016-11-21 14:22:03,774 INFO [org.jasig.cas.CentralAuthenticationServiceImpl] - <Granted service ticket [ST-3-K5Lq4ebScA3QzW95tBGS-cas01.example.org] for service [http://10.87.60.85:8080/TINS/j_spring_cas_security_check] for user [defaultus]>
2016-11-21 14:22:03,774 INFO [com.github.inspektr.audit.support.Slf4jLoggingAuditTrailManager] - <Audit trail record BEGIN
=============================================================
WHO: defaultus
WHAT: ST-3-K5Lq4ebScA3QzW95tBGS-cas01.example.org for http://10.87.60.85:8080/TINS/j_spring_cas_security_check
ACTION: SERVICE_TICKET_CREATED
APPLICATION: CAS
WHEN: Mon Nov 21 14:22:03 CST 2016
CLIENT IP ADDRESS: 10.87.61.79
SERVER IP ADDRESS: 10.87.60.85
=============================================================

>
2016-11-21 14:22:03,788 INFO [com.github.inspektr.audit.support.Slf4jLoggingAuditTrailManager] - <Audit trail record BEGIN
=============================================================
WHO: audit:unknown
WHAT: ST-3-K5Lq4ebScA3QzW95tBGS-cas01.example.org
ACTION: SERVICE_TICKET_VALIDATED
APPLICATION: CAS
WHEN: Mon Nov 21 14:22:03 CST 2016
CLIENT IP ADDRESS: 10.87.60.85
SERVER IP ADDRESS: 10.87.60.85
=============================================================

>
2016-11-21 14:23:29,947 INFO [org.jasig.cas.services.DefaultServicesManagerImpl] - <Reloading registered services.>
2016-11-21 14:23:29,949 INFO [org.jasig.cas.services.DefaultServicesManagerImpl] - <Loaded 1 services.>
2016-11-21 14:25:29,947 INFO [org.jasig.cas.services.DefaultServicesManagerImpl] - <Reloading registered services.>
2016-11-21 14:25:29,947 INFO [org.jasig.cas.services.DefaultServicesManagerImpl] - <Loaded 1 services.>

------------------------------------------------------------------------------------

deployerConfigContext.xml

<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:p="http://www.springframework.org/schema/p"
       xmlns:c="http://www.springframework.org/schema/c"
       xmlns:tx="http://www.springframework.org/schema/tx"
       xmlns:util="http://www.springframework.org/schema/util"
       xmlns:sec="http://www.springframework.org/schema/security"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
       http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.2.xsd
       http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.2.xsd
       http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">

    <bean id="authenticationManager" class="org.jasig.cas.authentication.PolicyBasedAuthenticationManager">
        <constructor-arg>
            <map>
               <entry key-ref="dbAuthHandler" value-ref="primaryPrincipalResolver" />
				
            </map>
        </constructor-arg>

        <property name="authenticationPolicy">
            <bean class="org.jasig.cas.authentication.AnyAuthenticationPolicy" />
        </property>
    </bean>
	
    <bean id="dataSource"

     class="com.mchange.v2.c3p0.ComboPooledDataSource"

     p:driverClass="com.mysql.jdbc.Driver"

     p:jdbcUrl="jdbc:mysql://165.202.6.132:3306/tins?useUnicode=true&amp;characterEncoding=utf8&amp;zeroDateTimeBehavior=convertToNull"

     p:user="tins"

     p:password="password" />
	 
    <bean id="passwordEncoder"

      class="org.jasig.cas.authentication.handler.DefaultPasswordEncoder"

      c:encodingAlgorithm="MD5"
	  
      p:characterEncoding="UTF-8" />
 

     <bean id="dbAuthHandler"

      class="org.jasig.cas.adaptors.jdbc.QueryDatabaseAuthenticationHandler"

      p:dataSource-ref="dataSource"

      p:sql="select Password from Staff where Login = ?"
	  
	  p:passwordEncoder-ref="passwordEncoder"

     />
	   
    <bean id="primaryPrincipalResolver"
          class="org.jasig.cas.authentication.principal.PersonDirectoryPrincipalResolver" >
        <property name="attributeRepository" ref="attributeRepository" />
    </bean>
	
    <bean id="attributeRepository" class="org.jasig.services.persondir.support.StubPersonAttributeDao"
            p:backingMap-ref="attrRepoBackingMap" />
    
    <util:map id="attrRepoBackingMap">
        <entry key="uid" value="uid" />
        <entry key="eduPersonAffiliation" value="eduPersonAffiliation" /> 
        <entry key="groupMembership" value="groupMembership" />
    </util:map>

    <bean id="serviceRegistryDao" class="org.jasig.cas.services.InMemoryServiceRegistryDaoImpl"
            p:registeredServices-ref="registeredServicesList" />

    <util:list id="registeredServicesList">
        <bean class="org.jasig.cas.services.RegexRegisteredService"
              p:id="0" p:name="HTTP and IMAP" p:description="Allows HTTP(S) and IMAP(S) protocols"
              p:serviceId="^(https?|imaps?)://.*" p:evaluationOrder="10000001" />

    </util:list>
    
    <bean id="auditTrailManager" class="com.github.inspektr.audit.support.Slf4jLoggingAuditTrailManager" />
    
    <bean id="healthCheckMonitor" class="org.jasig.cas.monitor.HealthCheckMonitor" p:monitors-ref="monitorsList" />
  
    <util:list id="monitorsList">
      <bean class="org.jasig.cas.monitor.MemoryMonitor" p:freeMemoryWarnThreshold="10" />

      <bean class="org.jasig.cas.monitor.SessionMonitor"
          p:ticketRegistry-ref="ticketRegistry"
          p:serviceTicketCountWarnThreshold="5000"
          p:sessionCountWarnThreshold="100000" />
    </util:list>
</beans>



加载中
0
请叫我刀刀

楼主你这个问题如何解决的

返回顶部
顶部