Announcement Announcement Module
Collapse
No announcement yet.
Weird behavioral GWT+Spring custom authentication Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Weird behavioral GWT+Spring custom authentication

    Hi All,

    I want to authenticating from my gwt app. with a simple j_spring_security by html post request.
    It works well in hosted mode and in mvn jetty:run-war.

    But when I deploy my application to the jetty, it doesn't works, I've got a 404 html error.

    I use Gwt 2.4.0 and Spring 3.1

    My relevant config is:
    Code:
         <security:http auto-config="false" use-expressions="true" access-denied-page="/Argus.html#!authPage"
                            entry-point-ref="authenticationEntryPoint" >
                    <security:intercept-url pattern="/*/!authPage" access="permitAll"/>									 
                    <security:logout
                                    invalidate-session="true"
                                    logout-success-url="/Argus.html#!authPage"
                                    logout-url="/logout"/>
                    <security:custom-filter ref="authenticationFilter" position="FORM_LOGIN_FILTER"/>
            </security:http>
    
            <bean id="authenticationFilter" class="org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter"
                    p:authenticationManager-ref="customAuthenticationManager"
                    p:authenticationFailureHandler-ref="customAuthenticationFailureHandler"
                    p:authenticationSuccessHandler-ref="customAuthenticationSuccessHandler"
                    p:filterProcessesUrl="/j_spring_security_check"
                     />
                    
            <bean id="customAuthenticationManager" class="com.argus.gwtp.server.spring.security.ArgusAuthenticationManager" /> 
    
            <bean id="customAuthenticationFailureHandler" class="org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler"
                    p:defaultFailureUrl="/Argus.html#!authPage?error=true" />
    
            <bean id="customAuthenticationSuccessHandler" class="org.springframework.security.web.authentication.SimpleUrlAuthenticationSuccessHandler"
                    p:defaultTargetUrl="/Argus.html#!authPage?login=success" />
            <bean id="authenticationEntryPoint" class="org.springframework.security.web.authentication.LoginUrlAuthenticationEntryPoint"
                    p:loginFormUrl="/j_spring_security_check"/>
            <security:authentication-manager/>
    in my gwt sending code is:

    Code:
    	String url = GWT.getModuleBaseURL() + "/j_spring_security_check";
    
    	StringBuffer postData = new StringBuffer(URL.encode(userName));
    	postData.append('=').append("j_username").append('&');
    	postData.append("j_password").append('=').append(password);
    
    	RequestBuilder builder = new RequestBuilder(RequestBuilder.POST, url);
    	builder.setHeader("Content-type", "application/x-www-form-urlencoded");
    What is the difference between mvn jetty:run-war and system started jetty?

    thx
    Zamek
    Last edited by zamek42; Feb 23rd, 2013, 07:29 AM.

  • #2
    I can solve the problem:

    I need change
    String url = GWT.getModuleBaseURL() + LOGIN_ACTION;
    to
    String url = GWT.getHostPageBaseURL() + LOGIN_ACTION;

    by Zamek

    Comment

    Working...
    X