1

私はspring-mvcで春のセキュリティWeb認証を使用していますが、これまでのところよくできていますが、今は私のアプリケーションのモバイル版を開発しています別のログインページを含むモバイルサイト用の異なるページセット。今私は問題が春のセキュリティを使用しているモバイルとデスクトップの異なるログインページ

がここで私は意味、さまざまな要求に応じて複数のログインページを持つことができますどのように今の私のApplicationContext-のsecurity.xml

<?xml version="1.0" encoding="UTF-8"?> 
<beans:beans xmlns="http://www.springframework.org/schema/security" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans" 
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd 
       http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.0.xsd"> 

    <http auto-config="true" lowercase-comparisons="false"> 
     <intercept-url pattern="/images/**" filters="none" /> 
     <intercept-url pattern="/Stylesheets/**" filters="none" /> 
     <intercept-url pattern="/JavaScript/**" filters="none" /> 
     <intercept-url pattern="/scripts/**" filters="none" /> 
     <intercept-url pattern="/favicon.ico" access="ROLE_ANONYMOUS" /> 
     <intercept-url pattern="/**" access="ROLE_USER,ROLE_ADMIN"/> 
     <intercept-url pattern="/mobile/**" access="ROLE_USER,ROLE_ADMIN"/> 
     <form-login login-page="/login.htm" authentication-success-handler-ref="customHandler" 
      authentication-failure-url="/login.htm?error=true" default-target-url="/home.htm" 
      login-processing-url="/j_security_check" /> 
     <remember-me user-service-ref="userDAO" key="e37f4b31-0c46-11dd-bd0b-0800200c9a66"/> 
    </http> 

    <beans:bean id="customHandler" class="com.example.auth.AuthenticationHandler"> 
    </beans:bean> 

    <authentication-manager> 
     <authentication-provider user-service-ref="userDAO"> 
      <!-- 
      TODO skipped to allow password emailing instead of password change and security 
      TODO question hell.. 
      --> 
      <!-- <password-encoder ref="passwordEncoder"/> --> 
     </authentication-provider> 
    </authentication-manager> 

</beans:beans> 

だと設定する必要があり、私の場合、ユーザーよりモバイルフォルダのページモバイルログインページが表示されます。 私はstackoverflowで同様の質問を見ましたが、それらは異なる役割に応じてログインページでしたが、私の場合は別のページのdiffログインが欲しいです。

こんにちは、ソリューションのおかげで、それは私のためにうまくいくようです。私は今、春のセキュリティ3.1に切り替えましたが、それは私に例外を与えています。これを解決するのを助けてくれますか?

Error creating bean with name 'org.springframework.security.filterChains': Cannot resolve reference to bean 'org.springframework.security.web.DefaultSecurityFilterChain#4' while setting bean property 'sourceList' with key [4]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.web.DefaultSecurityFilterChain#4': Cannot create inner bean '(inner bean)' of type [org.springframework.security.web.authentication.logout.LogoutFilter] while setting constructor argument with key [1]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#6': Cannot resolve reference to bean 'org.springframework.security.web.authentication.rememberme.TokenBasedRememberMeServices#0' while setting constructor argument with key [1]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.web.authentication.rememberme.TokenBasedRememberMeServices#0': Cannot create inner bean '(inner bean)' while setting bean property 'userDetailsService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#7': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanInitializationException: Property 'sessionFactory' is required for bean '(inner bean)#7' 

答えて

0

あなたは、Tスプリングセキュリティ3.1を切り替える働かを持っている場合、あなたは、単に2つのhttp要素1を定義することができます。あなたが切り替えることができない場合は、名前空間を介して完全に設定することはできませんが、entry-point-refとsomd <sec:custom-filter>要素を登録する必要があります。

+0

こんにちは、ソリューションのおかげで、それは私のためにうまくいくようです。私は今、春のセキュリティ3.1に切り替えましたが、それは私に例外を与えています。これを解決するのを助けてくれますか? –

関連する問題