Acegi (j_acegi_security_check)

Estou implementando o framework de segurança Acegi, porém encontrei problemas na hora do login.

A interceptação está acontecendo de forma correta, porém ao ir para a pagina de login, e enviar os dados, ele direciona pra uma pagina com a msg abaixo:

The requested resource (/j_acegi_security_check) is not available.

Esse é o bean que contém o j_acegi_security_check

<bean id="authenticationProcessingFilter" class="org.acegisecurity.ui.webapp.SiteminderAuthenticationProcessingFilter">
		<property name="authenticationManager"><ref bean="authenticationManager"/></property>
		<property name="authenticationFailureUrl"><value>/resources/acegilogin.jsp?login_error=1</value></property>
		<property name="defaultTargetUrl"><value>/</value></property>
		<property name="filterProcessesUrl"><value>/j_acegi_security_check</value></property>
	</bean>

e esse meu form:

<form action="j_acegi_security_check" method="POST">
				<p>
					&lt;label for="person_id"&gt;Login ID&lt;/label&gt;
					&lt;input type='text' name='j_username' &gt;
				</p>
				<p>
					&lt;label for="pwd"&gt;Password&lt;/label&gt;
					&lt;input type='password' name='j_password'&gt;
				</p>
				<p>
					&lt;input type="checkbox" name="_acegi_security_remember_me"&gt;Remember me 2 weeks<br/>
					&lt;input type="submit" value="Login" /&gt;
				</p>
			&lt;/form&gt;

Alguem já teve problema semelhante!?

e uma dúvida… o q é esse “j_acegi_security_check”? É algum servlet q eu tenha q mapear para fazer o login?!

Agradeço antecipadamente

O problema estava na configuração do applicationContext.

Segue o configurado corretamente:

&lt?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt
&lt;!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"&gt;

&lt;beans&gt;
	&lt;bean id="filterChainProxy" class="org.acegisecurity.util.FilterChainProxy"&gt;
		&lt;property name="filterInvocationDefinitionSource"&gt;
			&lt;value&gt; 
				CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON 
				PATTERN_TYPE_APACHE_ANT
				/**=httpSessionIntegrationFilter,authenticationProcessingFilter,anonymousProcessingFilter,exceptionTranslationFilter,filterInvocationInterceptor
			&lt;/value&gt;
		&lt;/property&gt;
	&lt;/bean&gt;

	&lt;bean id="filterInvocationInterceptor"
		class="org.acegisecurity.intercept.web.FilterSecurityInterceptor"&gt;
		&lt;property name="authenticationManager"&gt;
			&lt;ref bean="authenticationManager"/&gt;
		&lt;/property&gt;
		&lt;property name="accessDecisionManager"&gt;
			&lt;ref bean="accessDecisionManager"/&gt;
		&lt;/property&gt;
		&lt;property name="objectDefinitionSource"&gt;
			&lt;value&gt; 
				CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON 
				PATTERN_TYPE_APACHE_ANT
				/resources/auth.gsp=ROLE_ANONYMOUS 
				/**=ROLE_ADMIN
			&lt;/value&gt;
		&lt;/property&gt;
	&lt;/bean&gt;

	&lt;bean id="authenticationProcessingFilter"
		class="org.acegisecurity.ui.webapp.AuthenticationProcessingFilter"&gt;
		&lt;property name="authenticationManager"&gt;
			&lt;ref bean="authenticationManager"/&gt;
		&lt;/property&gt;
		&lt;property name="authenticationFailureUrl"&gt;
			&lt;value&gt;/resources/auth.gsp?login_error=1&lt;/value&gt;
		&lt;/property&gt;
		&lt;property name="defaultTargetUrl"&gt;
			&lt;value&gt;/&lt;/value&gt;
		&lt;/property&gt;
		&lt;property name="filterProcessesUrl"&gt;
			&lt;value&gt;/j_acegi_security_check&lt;/value&gt;
		&lt;/property&gt;
	&lt;/bean&gt;

	&lt;bean id="authenticationManager" class="org.acegisecurity.providers.ProviderManager"&gt;
		&lt;property name="providers"&gt;
			&lt;list&gt;
				&lt;ref local="daoAuthenticationProvider"/&gt;
				&lt;ref local="anonymousAuthenticationProvider"/&gt;
			&lt;/list&gt;
		&lt;/property&gt;
	&lt;/bean&gt;

	&lt;bean id="concurrentSessionController"
		class="org.acegisecurity.concurrent.ConcurrentSessionControllerImpl"&gt;
		&lt;property name="maximumSessions"&gt;
			&lt;value&gt;1&lt;/value&gt;
		&lt;/property&gt;
		&lt;property name="sessionRegistry"&gt;
			&lt;ref local="sessionRegistry"/&gt;
		&lt;/property&gt;
	&lt;/bean&gt;

	&lt;bean id="sessionRegistry" class="org.acegisecurity.concurrent.SessionRegistryImpl"/&gt;

	&lt;bean id="exceptionTranslationFilter" class="org.acegisecurity.ui.ExceptionTranslationFilter"&gt;
		&lt;property name="authenticationEntryPoint"&gt;
			&lt;ref local="authenticationProcessingFilterEntryPoint"/&gt;
		&lt;/property&gt;
		&lt;property name="accessDeniedHandler"&gt;
			&lt;bean class="org.acegisecurity.ui.AccessDeniedHandlerImpl"&gt;
				&lt;property name="errorPage" value="/accessDenied.jsp"/&gt;
			&lt;/bean&gt;
		&lt;/property&gt;
	&lt;/bean&gt;

	&lt;bean id="authenticationProcessingFilterEntryPoint"
		class="org.acegisecurity.ui.webapp.AuthenticationProcessingFilterEntryPoint"&gt;
		&lt;property name="loginFormUrl"&gt;
			&lt;value&gt;/resources/auth.gsp&lt;/value&gt;
		&lt;/property&gt;
		&lt;property name="forceHttps"&gt;
			&lt;value&gt;false&lt;/value&gt;
		&lt;/property&gt;
	&lt;/bean&gt;

	&lt;bean id="daoAuthenticationProvider"
		class="org.acegisecurity.providers.dao.DaoAuthenticationProvider"&gt;
		&lt;property name="userDetailsService"&gt;
			&lt;ref bean="inMemoryDaoImpl"/&gt;
		&lt;/property&gt;
		&lt;!--&lt;property name="saltSource"&gt;&lt;ref bean="saltSource"/&gt;&lt;/property&gt;--&gt;
		&lt;!--&lt;property name="passwordEncoder"&gt;
			&lt;ref bean="passwordEncoder"/&gt;
		&lt;/property&gt;--&gt;
	&lt;/bean&gt;

	&lt;!--&lt;bean id="passwordEncoder" class="org.acegisecurity.providers.encoding.Md5PasswordEncoder"/&gt;--&gt;

	&lt;bean id="inMemoryDaoImpl" class="org.acegisecurity.userdetails.memory.InMemoryDaoImpl"&gt;
		&lt;property name="userMap"&gt;
			&lt;value&gt;
				admin=password,ROLE_ADMIN 
				a=a,ROLE_ADMIN
				marissa=koala,ROLE_TELLER,ROLE_SUPERVISOR 
				dianne=emu,ROLE_TELLER
				scott=wombat,ROLE_TELLER 
				peter=opal,disabled,ROLE_TELLER 
			&lt;/value&gt;
		&lt;/property&gt;
	&lt;/bean&gt;

	&lt;bean id="httpSessionIntegrationFilter"
		class="org.acegisecurity.context.HttpSessionContextIntegrationFilter"&gt;
		&lt;property name="context"&gt;
			&lt;value&gt;org.acegisecurity.context.SecurityContextImpl&lt;/value&gt;
		&lt;/property&gt;
	&lt;/bean&gt;

	&lt;bean id="accessDecisionManager" class="org.acegisecurity.vote.UnanimousBased"&gt;
		&lt;property name="allowIfAllAbstainDecisions"&gt;
			&lt;value&gt;false&lt;/value&gt;
		&lt;/property&gt;
		&lt;property name="decisionVoters"&gt;
			&lt;list&gt;
				&lt;ref local="roleVoter"/&gt;
			&lt;/list&gt;
		&lt;/property&gt;
	&lt;/bean&gt;

	&lt;bean id="roleVoter" class="org.acegisecurity.vote.RoleVoter"/&gt;
	
	&lt;bean id="anonymousProcessingFilter" class="org.acegisecurity.providers.anonymous.AnonymousProcessingFilter"&gt;
		&lt;property name="key"&gt;&lt;value&gt;foobar&lt;/value&gt;&lt;/property&gt;
		&lt;property name="userAttribute"&gt;&lt;value&gt;anonymousUser,ROLE_ANONYMOUS&lt;/value&gt;&lt;/property&gt;
	&lt;/bean&gt;
	
	&lt;bean id="anonymousAuthenticationProvider" class="org.acegisecurity.providers.anonymous.AnonymousAuthenticationProvider"&gt;
		&lt;property name="key"&gt;&lt;value&gt;foobar&lt;/value&gt;&lt;/property&gt;
	&lt;/bean&gt;

&lt;/beans&gt;

Alguns links que ajudaram a resolver meu problema:

http://www.tfo-eservices.eu/wb_tutorials/media/SpringAcegiTutorial/HTML/SpringAcegiTutorial-1_1-html.html

http://bbweblog.kevinhooke.com/BBWeblog/viewPost.do?entryID=803&instanceID=1&categoryID=111&action=detail

:wink: