Authentication 使用JAAS在CAS服务器上进行身份验证
我正在尝试在CAS服务器上将CAS用于SSO和JAAS。用户信息在数据库表中。我为JAAS创建了自己的LoginModule,并在Authentication 使用JAAS在CAS服务器上进行身份验证,authentication,cas,jaas,Authentication,Cas,Jaas,我正在尝试在CAS服务器上将CAS用于SSO和JAAS。用户信息在数据库表中。我为JAAS创建了自己的LoginModule,并在JAAS.conf 下面是jaas.conf文件 </list> </property> </bean> <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"> <propert
JAAS.conf
下面是
jaas.conf
文件
</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>
我在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";
};
</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>
我发现JaasAuthenticationHandler
没有使用我的CasLoginModule
<bean class="org.jasig.cas.authentication.handler.support.JaasAuthenticationHandler" />
</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>
我在java源代码中编写了System.out.println
行,但没有输出,我错误地更改了jaas.conf文件中的类名,使之成为ClassNotFoundError
,但没有发生错误。
你认为原因是什么?
我无法解决我的问题
</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>
提前谢谢。查看我的代码..工作得很有魅力
<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>
</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>
用户/主机
用户名
用户密码
</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>
net.sourceforge.jtds.jdbc.Driver
jdbc:jtds:sqlserver://localhost:port/db
1234
密码
如果没有,请移除相应的jar并制作另一个。密码已加密。如何解密密码?用户表的描述在哪里?它是如何工作的?问题是关于使用JAAS的CAS,但您的答案指向了不同的身份验证处理程序,我相信。