Announcement Announcement Module
Collapse
No announcement yet.
AuthenticationManager with AcegiDigestPasswordValidationCallbackHandler Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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.

    Comment

    Working...
    X