Announcement Announcement Module
Collapse
No announcement yet.
Login From Other Site form Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Login From Other Site form

    Hi, Iīm new on Spring. I made a webapp with java/tomcat/spring to a client. Now, the client wants to put a form on his webpage, to login to my app. But the app itīs located on my server, and his webpage itīs on his server. I tried a Ajax request based on url of acgei security.

    function AjaxPost()
    {
    var xmlhttp = objectXML(); //Creates XML Request Object
    var data = "j_username=login&j_password=pass&acegiAjaxLogin=t rue";
    xmlhttp.open("POST", "http://www.mydomain.com/j_acegi_security_check", true);
    xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); // Setando Content-type
    xmlhttp.setRequestHeader("Content-length", dados_a_enviar.length); // Comprimento do conteúdo=comprimento dos dados a enviar
    xmlhttp.send(data);
    }

    I set my spring-security.xml authentication processing filter to


    <property name="filterProcessesUrl">
    <value>/j_acegi_security_check</value>
    </property>
    <property name="authenticationFailureUrl">
    <value>/login.html?login_error=1</value>
    </property>
    <property name="defaultTargetUrl">
    <value>/index.html</value>
    </property>
    <property name="authenticationManager">
    <ref bean="authenticationManager"/>
    </property>

    The Post is made correctly (Receives 200 response). Tomcat creates a session after the post, but my ajax request is empty.
    I know that I have to do something to receives the session created, but how can I do that ?
    How can I do a login from a external site ?

    Thanks,
    Renato Ferreira
Working...
X