I have multisite setup. SSO module installed and all working perfect.

I Have http://www.basedomain.com, http://sub1.basedomain.com and http://sub2.basedomain.com...

My dream flow is that; when a user click on "login link" from a block in a client site page, he/she will be redirected login form with a address like;

http://www.basedomain.com/user/login?destination=http://sub1.basedomain....

And after a sucessfull login he wil be redirected http://sub1.basedomain.com/node/2 (or which adress he/she was before) as a logged user...

As i know http://www.onsugar.com made this with a patch to sso module.

Any one can help on this?

CommentFileSizeAuthor
#7 singlesignon_client.module.patch471 bytesaaron1234nz

Comments

Oscar Illada’s picture

I wonder how popsugar do, if any one have the answer please let me know...

zyxware’s picture

Title: Login Destination as Client Site URL » Successful login does not redirect the user back to client site home
Category: feature » bug

I think the module is already designed to take the user back to the client site once the login form is submitted. Also the login form is submitted on the client site and not on the controller site. I checked it out on a multisite installation and it looks like on successful login the user is redirected to the home page of the controller site. I checked out the debug log in the singlesignon_controller_associate and $_GET['origin'] seems to be set but the redirection is not happening correctly to the client site.

zyxware’s picture

On the site that I had tried to debug, the problem was because of login_destination module which prevented singlesignon_controller_user_form_submit from getting executed as it was redirecting users to the home page of the controller site. So if SSO does not redirect users back to the client site as expected check out any other login related modules enabled on the controller site.

zyxware’s picture

You should also take a look at this patch that will make the sso redirect respect the destination querystring as well - #807104: SSO does not respect the destination querystring

decibel.places’s picture

I too have multisite and when I log into client site I am redirected to contoller site

it happens after I add the controller URL in client single signon admin settings

I tried the patch in #807104: SSO does not respect the destination querystring but it does not help

I wonder if my db tables are set up right, the controller site has no prefix and the client site is installed in the same db with prefix "zinsuldata_"

so I added this to settings.php of the client multisite

$db_prefix = array(
     'default'        => 'zinsuldata_',
     'authmap'        => '',
     'sessions'       => '',
     'users'          => '',
   );

status report says tables successfully shared

I also noticed that the database password "p=pBU(OMETP}" was converted to "p%3DpBU%28OMETP%7D" in the client site by the Drupal installer, but still seems to work

zyxware’s picture

@decibel.places - Can you please see if there are any login redirection modules like login destination installed on the controller site? The patch provided at #807104: SSO does not respect the destination querystring only adds the support for destination querystring. That is not the issue that you are facing here.

aaron1234nz’s picture

StatusFileSize
new471 bytes

This is easily fixed with a one line change in the singlesignon_client.module.

-    $origin = $base_url . '?' . $query;
+    $origin = $base_url . request_uri(). '?' . $query;