0

我们已经将 SimpleSaml 与 Drupal 7 设置为 IP,以允许用户使用他们的 Drupal 凭据登录到第 3 方服务。一切似乎都在工作,直到用户在 Drupal 登录页面上输入他们的凭据,但是,一旦他们登录,他们就会被重定向到 SimpleSaml“演示示例”页面。(module.php/core/authenticate.php)

他们的所有详细信息都是正确的,并且经过了明确的身份验证,但从未发生过重定向回第 3 方站点的情况。我们已经检查,第 3 方正在发送正确的(编码的)数据,包括 AssertionConsumerServiceURL。

问题是要弄清楚如何让 Drupal 重定向回第 3 方 url。

使用的库:

simpleSAMLphp version 1.11.0
drupalauth for SimpleSAMLphp 1.7+ and Drupal 7.x
drupalauth4ssp (which comes with the drupalauth module)

配置:

SimpleSaml 2
store.type: sql
auth as: drupal-userpass
Apache is configured correctly
We are on Centos 
We have SSL offload implemented on our test environment which seems to be working ok
(Load balancer 443 offloads to Apache 80)

authsources.php 的内容:

$config = array(

// This is a authentication source which handles admin authentication.
'admin' => array(
    // The default is to use core:AdminPassword, but it can be replaced with
    // any authentication source.
    'core:AdminPassword',
),
'drupal-userpass' => array(
        'drupalauth:External',

        // The filesystem path of the Drupal directory.
        'drupalroot' => '/var/www/html/',

    // Whether to turn on debug
        'debug' => TRUE,

        // the URL of the Drupal logout page
        'drupal_logout_url' => 'https://[drupal_domain]/user/logout',

        // the URL of the Drupal login page
        'drupal_login_url' => 'https://[drupal_domain]/user',

        // Which attributes should be retrieved from the Drupal site.

           'attributes' => array(
               array('drupaluservar' => 'uid',  'callit' => 'uid'),
               array('drupaluservar' => 'name', 'callit' => 'cn'),
               array('drupaluservar' => 'mail', 'callit' => 'mail'),
               array('drupaluservar' => 'field_user_firstname',  'callit' => 'givenName'),
               array('drupaluservar' => 'field_user_lastname',   'callit' => 'sn'),
               array('drupaluservar' => 'roles','callit' => 'roles'),
           ),
),

);

如果需要,我很乐意发布更多信息。

4

2 回答 2

0

这里有很多提示可能有问题http://code.google.com/p/drupalauth/source/browse/trunk/drupalauth/lib/Auth/Source/External.php

几件事值得检查:

  • “您必须将 config/config.php 中的 store.type 配置为 phpsession 以外的其他内容,否则此模块将无法工作”取自第 17-19 行
  • 似乎正在第 335 行生成重定向 url
  • 检查文件的行和335文件,看看你有什么值(你可以使用一些调试工具,比如Xdebug346External.php
  • 在整体调试中,您的代码将更清楚地说明您面临的问题
于 2013-10-11T12:54:01.437 回答
0

一个老问题,但如果你没有/没有解决它。您应该将重定向 URL 包含在 RelayState SAML 参数中

SAML 请求:

<samlp:Response xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"
            xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion"
            ID="_b6a80234ed663a4a818be0e80326ed4e0217b2fae4"
            Version="2.0"
            IssueInstant="2015-09-23T23:18:03Z"
            Destination="http://www.domain.com/saml_login/idp?destination=other_siteURL"

Drupal 请求:

www.domain.com/saml_login/idp?destination=other_siteURL (encode the destination)

此外,您可能需要从 simplesamlphp Drupal 模块中删除一些验证

IE

 // See if a URL has been explicitly provided in ReturnTo. If so, use it (as long as it points to this site). ?>

 if (( isset($_REQUEST['ReturnTo'] ) && $_REQUEST['ReturnTo']) &&
(valid_url( $_REQUEST['ReturnTo'] ) && stristr($_REQUEST['ReturnTo'], $base_url)))

然后 Drupal 会带你到:other_siteURL

于 2015-09-23T23:27:13.653 回答