Is it possible to have multiple authsources, i know that simplesamlphp can handle this, but is this possible within the module?

CommentFileSizeAuthor
#2 multiple_authsource-1977748-2.patch5.86 KBsumachaa

Comments

sumachaa’s picture

Version: 7.x-2.0-alpha2 » 7.x-3.x-dev
Issue summary: View changes

Has anyone tried this?

We are also having similar request;

In the login page, we have 2 links for login

  1. Login with AuthSource1
  2. Login with AuthSource2

We can configure simplesamlphp with multiple sources; but in the Drupal module; when using the "/saml_login" URL to take the user to the login page, it always take the default Auth Source; which happens from the below line

https://git.drupalcode.org/project/simplesamlphp_auth/-/blob/7.x-3.x/sim...

Whenever the $_simplesamlphp_auth_as is initiated it uses default value;

Is there a way to initiate this depending on different auth source?

sumachaa’s picture

so a quick fix for this would be:

Assumption

Multiple authsources are setup with SimpleSAMLphp (using authsources.php)

Task Action
way to initate SimpleSAML_Auth_Simple class with appropriate authsource when calling /saml_login page, pass authsource as query string parameter to the request (SimpleSAMLphp libraray uses the same approach) uses "as" as the query string parameter; example: /saml_login?as=sp1; /saml_login?as=company-sp; Initiate class SimpleSAML_Auth_Simple with the authsource if present
identify a way to keep track of the authsource user logged-in with; using a $_SESSION variable to keep track of the authsource right after the hook_simplesamlphp_auth_pre_login
determine way to manage multiple attributes to sync (simplesamlphp_auth_unique_id and simplesamlphp_auth_user_name) follow an approach taken in the 8.x project of allowing to set multiple comma-separated attributes. Update code to check for these

Attached a patch with the above items implemented against 7.x-3.x-dev branch