I am using simplesamlphp_auth on a D6 multisite setup with each subsite as a 'subfolder' (site.com/subsite1, site.com/subsite2). User and profile tables are shared across all, but these sites are country or region specific. I would like for a user to login (or register) and be redirected back to the page from where they logged in, instead of their user account page.

The current code being used to make this happen is:
print l("Login", "https://site.com/subsite1/saml_login?", array('query' => 'destination=' . $_GET['q']));
and is located in a php block.

Perhaps there could be a checkbox that allows the admin to select "direct user to account" or "return user to login location."

Thanks for the consideration.

Comments

geekwisdom’s picture

Assigned: Unassigned » geekwisdom
Status: Active » Fixed

I have corrected this in the 6.x-2.x branch. See: http://drupalcode.org/project/simplesamlphp_auth.git/commit/26052d7fbd22...

This fix allows you to provide the ReturnTo parameter to /saml_login if you want to send a user to a specific place after logging in. It also considers the HTTP_REFERER for returning users to the page they where on when they clicked on the link to /saml_login.

doublejosh’s picture

I added this feature in the dynamic login link.
#1568172: Configurable dynamic destination login/logout menu links

The patch including the links should also include this...

// within simplesamlphp_auth_loginpage()
else {
  if (isset($params['ReturnTo'])) {
    drupal_goto($params['ReturnTo']);
  }
  else {
    drupal_goto('user/' . $user->uid);
  }
}

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

doublejosh’s picture

I not been able to successfully get the the simpleSAMLphp library to execute the ReturnTo. It get dropped in the handoff.
RE: $_simplesamlphp_auth_as->requireAuth($my_params);

Believe that our OpenAM IdP is destroying the details during authentication.

Anyone dealt with this?

doublejosh’s picture

Status: Closed (fixed) » Active

Have this solved. Creating patch.

colan’s picture

Status: Active » Closed (duplicate)

May as well roll that fix into the patch for the other issue.

  • geekwisdom committed 5714c39 on 7.x-3.x
    Issue #1373334 by kpastore: Return user to same page after login. (...
  • geekwisdom committed 5b1aa43 on 7.x-3.x
    Issue #1373334 by kpastore: corrections to the fix for this issue.