2012-12-26 47 views
2

我正尝试在CAS服务器上使用CAS进行SSO和JAAS。用户信息在数据库表上。我为JAAS创建了自己的LoginModule,并在jaas.conf中配置了我的LoginModule。
以下是jaas.conf文件。使用JAAS在CAS服务器上进行身份验证

,我添加了以下行deployerConfigContext.xml

CAS { 
    com.usol.cas.sample.CasLoginModule required debug=true 
    driver="com.mysql.jdbc.Driver" 
    url="jdbc:mysql://linux.ssoserver/ssotest" 
    user="cas" 
    password="cas"; 
}; 

我发现JaasAuthenticationHandler不使用我的CasLoginModule。

<bean class="org.jasig.cas.authentication.handler.support.JaasAuthenticationHandler" /> 

我写System.out.println线在我的Java源代码,但没有输出和我的Jaas.conf文件改变了我的类名称不正确,使ClassNotFoundError但没有错误发生。 你认为什么原因? 我无法解决我的问题。

预先感谢您。

回答

1

结帐我的代码..working就像一个魅力..

<bean 
       class="org.jasig.cas.authentication.principal.HttpBasedServiceCredentialsToPrincipalResolver" /> 
     </list> 
    </property> 

    <!-- 
     | Whereas CredentialsToPrincipalResolvers identify who it is some Credentials might authenticate, 
     | AuthenticationHandlers actually authenticate credentials. Here we declare the AuthenticationHandlers that 
     | authenticate the Principals that the CredentialsToPrincipalResolvers identified. CAS will try these handlers in turn 
     | until it finds one that both supports the Credentials presented and succeeds in authenticating. 
     +--> 
     <property name="authenticationHandlers"> 
     <list> 

       <bean class="org.jasig.cas.authentication.handler.support.HttpBasedServiceCredentialsAuthenticationHandler" p:httpClient-ref="httpClient"></bean> 

user_master USER_NAME USER_PASSWORD

  </list> 
     </property> 
</bean> 


    <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"> 
    <property name="driverClassName"> 
      <value>net.sourceforge.jtds.jdbc.Driver</value> 
    </property> 

    <property name="url"> 
      <value>jdbc:jtds:sqlserver://localhost:port/db</value> 
    </property> 

    <property name="username"> 
      <value>1234</value> 
    </property> 

    <property name="password"> 
     <value>password</value> 
    </property> 
</bean> 
+1

如果不影响删除相应的罐子,再拍一张。 –

+0

密码被加密。你如何解密密码?用户表的描述在哪里?它是如何工作的? – Dongkyun

+0

问题是关于CAS与JAAS,但你的答案是指向一个不同的身份验证处理程序,我相信。 – Siddharth

相关问题