Results 1 to 2 of 2

Thread: AuthenticationManager with AcegiDigestPasswordValidationCallbackHandler

  1. #1
    Join Date
    Aug 2006
    Posts
    2

    Default AuthenticationManager with AcegiDigestPasswordValidationCallbackHandler

    Hi, all. I am having a (possibly newbie) issue, and can't find the solution anywhere. I am attempting to authenticate against my web services using digest passwords. However, anytime I try to bring up the user roles through SecurityContextHolder.getContext().getAuthenticati on().getAuthorities(), it returns null. I'm assuming that this is because there is no AuthenticationManager associated with my AcegiDigestPasswordValidationCallbackHandler, but I don't know of a way to make that association -- the only properties that can be set are the userDetailsService and the userCache.

    Any ideas? Below is a snippet of my applicationContext-security.xml

    Code:
        <bean id="jdbcDaoImpl"
            class="com.fyicorp.datafeeder.unified.dao.impl.UserDAOImpl"
            init-method="init">
            <property name="dataSource">
                <ref bean="configDataSource" />
            </property>
        </bean>
    
        <bean id="authenticationManager"
            class="org.acegisecurity.providers.ProviderManager">
            <property name="providers">
                <bean
                    class="org.acegisecurity.providers.dao.DaoAuthenticationProvider">
                    <property name="userDetailsService" ref="jdbcDaoImpl" />
                </bean>
            </property>
        </bean>
    
        <bean id="wsSecurityInterceptor"
            class="org.springframework.ws.soap.security.xwss.XwsSecurityInterceptor">
            <property name="policyConfiguration"
                value="classpath:securityPolicy.xml" />
            <property name="callbackHandlers">
                <list>
                    <ref bean="keyStoreHandler" />
    			    <bean class="org.springframework.ws.soap.security.xwss.callback.acegi.AcegiDigestPasswordValidationCallbackHandler">
    			        <property name="userDetailsService" ref="jdbcDaoImpl"/>
    			    </bean>
                    <bean id="acegiPasswordHandler"
                        class="org.springframework.ws.soap.security.xwss.callback.acegi.AcegiPlainTextPasswordValidationCallbackHandler">
                        <property name="authenticationManager"
                            ref="authenticationManager" />
                    </bean>
                </list>
            </property>
        </bean>
    Thanks!

  2. #2
    Join Date
    Jul 2005
    Location
    Rotterdam, the Netherlands
    Posts
    1,562

    Default

    I'm not an expert on Acegi, but I think putting the authorities in the UserDetails object is the responsibility of the UserDetailService. So if com.fyicorp.datafeeder.unified.dao.impl.UserDAOImp l doesn't put them there, they will not be present.

    Check out the FrequentFlyerDetails in the airline sample to see how I've done it. In this case, the list of granted authorities is a static field, but you can make it dynamic.
    Arjen Poutsma

    Spring Web Services Dev Lead
    Please read the FAQ

Posting Permissions

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