我目前已經配置好彈簧安全並正常工作。我想讓CAS工作,以便我可以在我編寫的多個應用程序中進行單點登錄。我很困惑如何讓cas使用我的自定義userdetailService。用Spring Security實現CAS 3
目前我有,這是我的彈簧security.xml文件
<authentication-manager alias="authManager">
<authentication-provider user-service-ref="userDetailsService">
<password-encoder ref="passwordEncoder">
<salt-source ref="saltSource"/>
</password-encoder>
</authentication-provider>
</authetication-manager>
從所有CAS的例子,我發現他們說的做執行管理是這樣的:
<beans:bean id="casAuthenticationProvider" class="org.springframework.security.cas.authentication.CasAuthenticationProvider">
<beans:property name="authenticationUserDetailsService">
<beans:bean class="org.springframework.security.core.userdetails.UserDetailsByNameServiceWrapper">
<beans:constructor-arg ref="userDetailsService"/>
</beans:bean>
</beans:property>
<beans:property name="serviceProperties" ref="serviceProperties"/>
<beans:property name="ticketValidator">
<beans:bean class="org.jasig.cas.client.validation.Cas20ServiceTicketValidator">
<beans:constructor-arg index="0" value="https://localhost:8443/cas"/>
</beans:bean>
</beans:property>
<beans:property name="key" value="1234554321"/>
</beans:bean>
<authentication-manager alias="authManager">
<authentication-provider ref="casAuthenticationProvider"/>
</authentication-manager>
的文檔混亂。我如何從一個正在運行的spring-security應用程序轉換到實現cas的應用程序,並仍然使用我的自定義用戶詳細信息?另外我需要在jsp頁面上進行更改?任何幫助將非常感激。
感謝
你是什麼意思「實現CAS並仍然使用我的自定義用戶的詳細信息」?如果您使用CAS服務器,則希望該服務器執行身份驗證。你的應用程序不會再這樣做了。 (但是,也許你想允許匿名訪問)。 – Andy
在我的春季安全應用程序中,我有一個passwordencoder和saltource beans來加密我的密碼。我還有一個實現了UserDetailsService的自定義UserDetails bean。我想我很困惑如何將這些轉換爲cas,所以一切仍然正常。我還創建了自己的角色,權限等 – blong824