0

我在 Drupal 8 和 IIS(8.5 版)中的 shibboleth 身份验证(模块:shib_auth 8.x-1 .x-dev)有问题,在 IDP 中登录后,我重定向到 Drupal,但我没有登录。
使用 SAML 浏览器扩展,我看到https://example.com/SAML2/POST的 POST 调用,此调用打开一个带有调试信息的 drupal 登录页面,我在其中找到服务器数组变量中的用户名和电子邮件,但未设置模块部分shib_auth 变量。
我检查 /Shibboleth.sso/Session 并发现正确打开的会话具有正确的属性。

我在报告中没有任何错误,用户存在于数据库中(shib_authmap 表)并且没有新用户。我认为该问题出在 shib_auth 模块配置中,但我在 drupal 站点中找不到任何日志文件或错误。

这是我的配置:

我的 IIS 网络配置:

<rule name="Ignore Shibboleth" stopProcessing="true">        
<match  url="Shibboleth\.sso" />        
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />        
<action  type="None" />
</rule>

我的 shibboleth2.xml:

<Host scheme="https" name="mysite.com"  requireSession="true" authType="shibboleth">
<Path name="secure" authType="shibboleth" requireSession="true"/>
<Path name="shib_login" authType="shibboleth" requireSession="true" />
</Host>
...
<ApplicationDefaults entityID="mysite.com"
REMOTE_USER="eppn persistent-id targeted-id username email firstname lastname"
...
<Sessions lifetime="28800" timeout="3600" relayState="ss:mem"
checkAddress="false" handlerSSL="true" cookieProps="https"
 handlerURL="/Shibboleth.sso">
...
<SSO entityID="https://MYIDP.com">
SAML2 SAML1
 </SSO>
<SessionInitiator type="Chaining" Location="/Login" isDefault="true"
relayState="cookie" entityID="https://MYIDP.com">
<SessionInitiator type="SAML2" acsIndex="1" template="bindingTemplate.html"/>
</SessionInitiator>
<LogoutInitiator type="Chaining" Location="/Logout" relayState="cookie">
<LogoutInitiator type="SAML2" template="bindingTemplate.html"/>
<LogoutInitiator type="Local"/>
</LogoutInitiator>
...

我的 .htaccess 用于 drupal 站点:

<Location / >
  AuthType shibboleth
  ShibRequireSession on
  ShibUseHeaders on
  require shibboleth
</Location>

调试 shib_auth 信息:

$_SERVER:
Array (
    [HTTP_REMOTEUSER] => value of REMOTEUSER
    [HTTP_USERNAME] => value of USERNAME
    [HTTP_LASTNAME] => value of LASTNAME
    [HTTP_FIRSTNAME] => value of FIRSTNAME
    [HTTP_EMAIL] => value of EMAIL
...
)

模块配置:

Array
(
    [_core] => Array
        (
            [default_config_hash] => 
        )

    [debug_prefix_path] => /user/
    [enable_debug_mode] => 1
    [force_https_on_login] => 1
    [logout_error_message] => 

    [server_variable_email] => HTTP_EMAIL -> not valorized
    [server_variable_username] => HTTP_USERNAME -> not valorized

    [shibboleth_account_linking_text] => Link this account with another identity
    [shibboleth_login_handler_url] => /Shibboleth.sso/Login
    [shibboleth_login_link_text] => Shibboleth Login
    [shibboleth_logout_handler_url] => /Shibboleth.sso/Logout
    [url_redirect_login] => /
    [url_redirect_logout] => /
)

非常感谢您的任何建议或回复

4

1 回答 1

0

我解决了这个问题,我安装了匿名重定向模块并在重定向 URL 覆盖中插入“/shib_login”。
此解决方法允许 Shibboleth 在 idp 登录后调用 shib_login 页面并设置 shib_auth 变量,这允许登录用户进入站点。

于 2020-02-28T10:57:15.500 回答