-
Aug 18th, 2005, 04:59 AM
#1
BasicProcessingFilter!!!
hey there i have a problem with BasicProcessingFilter (kowing that i use DaoAuthenticationProvider as a provider and also i use hibernate )when i request a secured page with BasicProcessingFilter the dialog that prompets me for password and username appear and i insert the password and the user name but it throws the authentication exception and ask me again about the password and the user name i enabled the hibernate logs but nothing happens in hibernate when i submit...so what is the problem here??
here is my spring-security.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<!-- -----------------------------------securityFilter Part--------------------------------------------------- -->
<bean id="securityEnforcementFilter"
class="net.sf.acegisecurity.intercept.web.Security EnforcementFilter">
<property name="securityInterceptor">
<ref bean="securityInterceptor" />
</property>
<property name="authenticationEntryPoint">
<ref bean="authenticationEntryPoint" />
</property>
</bean>
<!-- -----------------------------------Interceptor Part------------------------------------------------------ -->
<bean id="securityInterceptor"
class="net.sf.acegisecurity.intercept.web.FilterSe curityInterceptor">
<property name="authenticationManager">
<ref bean="authenticationManager" />
</property>
<property name="accessDecisionManager">
<ref bean="accessDecisionManager" />
</property>
<property name="objectDefinitionSource">
<value>
CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON
\A/Bank/.*\Z=ROLE_ADMIN
</value>
</property>
</bean>
<!-- -----------------------------------Authontication Provider----------------------------------------------- -->
<bean id="authenticationProvider"
class="net.sf.acegisecurity.providers.dao.DaoAuthe nticationProvider">
<property name="authenticationDao">
<ref bean="authenticationDao" />
</property>
</bean>
<bean id="authenticationDao"
class="net.sf.acegisecurity.providers.dao.jdbc.Jdb cDaoImpl">
<property name="dataSource">
<ref bean="dataSource" />
</property>
<property name="usersByUserNameQuery">
<value>
SELECT userName, password FROM users WHERE userName=?
</value>
</property>
<property name=”authoritiesByUserNameQuery”>
<value>
SELECT userName, privilege, enabled FROM
users where userName=?
</value>
</property>
<property name="userCache">
<ref bean="userCache" />
</property>
</bean>
<!-- ---------------------------------------------User Cach------------------------------------------------- -->
<bean id="userCache"
class="net.sf.acegisecurity.providers.dao.cache.Eh CacheBasedUserCache">
<property name="minutesToIdle">10</property>
</bean>
<!-- ---------------------------------------AuthenticationEntryPoint --------------------------------------- -->
<bean id="authenticationEntryPoint"
class="net.sf.acegisecurity.ui.basicauth.BasicProc essingFilterEntryPoint">
<property name="realmName">
<value>4S Login</value>
</property>
</bean>
<!-- --------------------------------------BasicAuthenticationfilter---------------------------------------- -->
<bean id="basicProcessingFilter"
class="net.sf.acegisecurity.ui.basicauth.BasicProc essingFilter">
<property name="authenticationManager">
<ref bean="authenticationManager" />
</property>
<property name="authenticationEntryPoint">
<ref bean="authenticationEntryPoint" />
</property>
</bean>
<!-- ----------------------------------------AuthenticationManager------------------------------------------ -->
<bean id="authenticationManager"
class="net.sf.acegisecurity.providers.ProviderMana ger">
<property name="providers">
<list>
<ref bean="authenticationProvider" />
</list>
</property>
</bean>
<!-- --------------------------------------IntegerationFilter for HttpSession------------------------------- -->
<bean id="integrationFilter"
class="net.sf.acegisecurity.ui.webapp.HttpSessionI ntegrationFilter" />
<!-- ---------------------------------------------DecisionManager------------------------------------------- -->
<bean id="accessDecisionManager"
class="net.sf.acegisecurity.vote.UnanimousBased">
<property name="decisionVoters">
<list>
<ref bean="roleVoter" />
</list>
</property>
</bean>
<bean id="roleVoter" class="net.sf.acegisecurity.vote.RoleVoter" />
</beans>
thanks alot for your time
-
Aug 18th, 2005, 07:52 AM
#2
well the problem was with the Basic fillter itself dont know why but i tried the Form Based authentication and it worked well...
-
Aug 23rd, 2005, 07:22 PM
#3
I was going to say:
Code:
\A/Bank/.*\Z=ROLE_ADMIN
is incorrect because you're converting to lowercase. It should be:
Code:
\A/bank/.*\Z=ROLE_ADMIN
However, if your problem was fixed I suppose you noticed that.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules