2012-12-26 146 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

相關問題