Results 1 to 9 of 9

Thread: How to check user and password, when I use Cas 3 and AuthenticationUserDetailsService

Threaded View

  1. #1
    Join Date
    Nov 2009
    Location
    Kazan, Tatarstan Republic, Russia Federation
    Posts
    8

    Post How to check user and password, when I use Cas 3 and AuthenticationUserDetailsService

    I use CAS and Spring Security 3.0. But I can't check password. How can I do it?
    My configuration xml is:
    <bean id="authenticationUserDetailsService" class="app.MyAuthenticationUserDetailsService"/>

    <bean id="proxyGrantingTicketStorage" class="org.jasig.cas.client.proxy.ProxyGrantingTic ketStorageImpl"/>


    <bean id="myPasswordEncoder" class="app.MyPasswordEncoder">
    </bean>



    <sec:http entry-point-ref="casProcessingFilterEntryPoint">
    <sec:intercept-url pattern="/forgotpass.xhtml" access="ROLE_ANONYMOUS"/>
    <sec:intercept-url pattern="/error.xhtml" access="ROLE_ANONYMOUS"/>
    <sec:intercept-url pattern="/*.xhtml" access="ROLE_USER"/>

    <sec:custom-filter ref="casAuthenticationFilter" after="CAS_FILTER"/>
    </sec:http>



    <sec:authentication-manager alias="authenticationManager">
    <sec:authentication-provider ref="casAuthenticationProvider">
    <sec: password-encoder ref="myPasswordEncoder"/>
    </sec:authentication-provider>

    </sec:authentication-manager>

    <bean id="casAuthenticationFilter" class="org.springframework.security.cas.web.CasAut henticationFilter">
    <property name="authenticationManager" ref="authenticationManager"/>
    <property name="authenticationFailureHandler">
    <bean class="org.springframework.security.web.authentica tion.SimpleUrlAuthenticationFailureHandler">
    <property name="defaultFailureUrl" value="/error.xhtml"/>
    <property name="useForward" value="true"/>
    </bean>
    </property>
    <property name="authenticationSuccessHandler">
    <bean class="org.springframework.security.web.authentica tion.SimpleUrlAuthenticationSuccessHandler">
    </bean>
    </property>
    <property name="proxyGrantingTicketStorage" ref="proxyGrantingTicketStorage"/>
    <property name="proxyReceptorUrl" value="/secure/receptor"/>
    </bean>

    <bean id="casAuthenticationProvider" class="org.springframework.security.cas.authentica tion.CasAuthenticationProvider">

    <property name="authenticationUserDetailsService" ref="authenticationUserDetailsService"/>
    <property name="serviceProperties" ref="serviceProperties"/>
    <property name="ticketValidator">
    <bean class="org.jasig.cas.client.validation.Cas20Servic eTicketValidator">
    <constructor-arg index="0" value="https://localhost:8443/cas"/>
    <property name="proxyGrantingTicketStorage" ref="proxyGrantingTicketStorage"/>
    <property name="proxyCallbackUrl" value="http://localhost:8080/app/secure/receptor"/>
    </bean>
    </property>
    <property name="key" value="an_id_for_this_auth_provider_only"/>
    </bean>

    <bean id="casProcessingFilterEntryPoint" class="org.springframework.security.cas.web.CasAut henticationEntryPoint">
    <property name="loginUrl" value="https://localhost:8443/cas/login"/>
    <property name="serviceProperties" ref="serviceProperties"/>
    </bean>

    <bean id="serviceProperties" class="org.springframework.security.cas.ServicePro perties">
    <property name="sendRenew" value="false"/>
    <property name="service" value="http://localhost:8080/app/j_spring_cas_security_check"/>
    </bean>

    method of MyAuthenticationUserDetailsService returns UserDetail with username and encoded password.
    MyPasswordEncoder encode it with same algorithm.
    But 1)I put logs to MyPasswordEncoder and it doesn't riched
    2) I try to enter to system with user 'admin' and password 'admin11'(it is right), but I can enter only with password 'admin'.

    Is my way to check user and password wrong?
    Last edited by KamilBek; Apr 7th, 2010 at 08:01 AM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •