Search code examples
drupal-8drupal-modulesiis-8shibboleth-sp

Drupal module shib_auth configuration for Shibboleth SP in IIS


I have an issue with shibboleth authentication (module: shib_auth 8.x-1 .x-dev) in Drupal 8 and IIS (version 8.5), after login in IDP i'm redirect to Drupal, but i'm not logged.
With SAML browser extension i see a POST call for https://example.com/SAML2/POST, this call open a drupal login page with debug information where i find the username and email in Server array variables, but the module section not set shib_auth variables.
I check /Shibboleth.sso/Session and i find correctly open session with correct attributes.

I haven't any error in reports, user is present in database (shib_authmap table) and there isn't new user. I think that issue is in shib_auth module configuration, but i'm not find any log file or error in drupal site.

This is my configuration:

My IIS webcofig:

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

My 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>
...

My .htaccess for drupal site:

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

Debug shib_auth information:

$_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
...
)

Module configuration:

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] => /
)

Thanks a lot for any suggestion or response


Solution

  • i resolve this issue, i install Anonymous Redirect module and insert "/shib_login" in Redirect URL Overrides.
    This workaround allow Shibboleth to call shib_login page and set shib_auth variables after idp login, this allow logged user to enter in site.