Drupal Site login from wordpress page

I am trying to logged in to drupal site from wordpress using ajax. Scenario is like below:

I have 2 sites one is wordpress and one is in drupal. Right now half of the functionality is in drupal and I am switching to wordpress. But now User needs to be logged in drupal site from wordpress page. I already set all the pages in wordpress if user is logged in drupal. BUt issue I am getting to make users logged in to drupal from the wordpress page.
But I did: I created the sign in page in drupal and set the email & password from get request and auto submitted the page on loading. It is working fine if I opened this page in broser So I am calling this page from wordpress page using ajax. I got 200 response from ajax call but user is not logged in drupal.

Related posts

Leave a Reply

2 comments

  1. Here is the login form from your page

    <form action="http://www.seniorsearch.com/content/sign" class="webform-client-form" id="signin">
                                <div id="webform-component-name">
                                    <input type="hidden" value="0" id="fb_login_id" name="submitted[fb_login_id]">
                                    <input type="hidden" value="" id="redirect_url" name="submitted[redirect_url]">
                                    <input type="text" class="form-text name1" maxlength="128" size="60" value="" name="submitted[name]" id="edit-submitted-name" placeholder="Enter Email">
                                 </div>
                                  <div id="webform-component-pass">
                                    <input type="password" class="form-text pass1" id="password" name="submitted[pass]" placeholder="Enter Password" maxlength="128" size="60" value="" >
                                    <input type="hidden" value="" name="details[sid]" id="sid">
                                    <input type="hidden" value="1" name="details[page_num]" id="page_num">
                                    <input type="hidden" value="1" name="details[page_count]" id="page_count">
                                    <input type="hidden" value="0" name="details[finished]" id="finished">
                                    <input type="hidden" value="form-_OBf1JYKx79Qg5_hsPtYAWmCPrRX6DwFKSODz4M7Wk4" name="form_build_id" id="form_build_id">
                                    <input type="hidden" value="webform_client_form_52" name="form_id" id="form_id">
                                    <input type="hidden" value="webform-ajax-wrapper-52" name="webform_ajax_wrapper_id" id="webform_ajax_wrapper_id">
                                    </div>
                                    <input type="submit" value="" name="op" class="form-submit ajax-processed" id="submit"><span class="termss">I accept Senior Search's Terms of Use.</span>
                                </form>
    

    You need to send every one of those parameters with your AJAX script if you want the login to work.

  2. I created the signin and signup form in drupal without any header, footer and sidebar, so There is only form there and call that page in wordpress site using iframe. Then refresh the iframe top window in drupal code after successful login.