Shibboleth IdP not passing AD LDAP attributes to TestShib SP

James, Todd R. trj at h2law.com
Tue Dec 12 16:28:23 EST 2017


I can't seem to figure this out after much research and trial and error. This is using Shibboleth IdP 3.3.2. I can successfully authenticate via LDAP (on Active Directory) with my email address and it seems that the LDAP attributes are being returned successfully according to ldaptive DEBUG logs, but the attributes are not being passed back to the SP.

FWIW, I would prefer to use sAMAccountName as the canonical username for our users, but allow them to authenticate using any email alias on their account. In other applications, finding the correct account by email address is done using a query like this in AD: (proxyAddresses=smtp:EMAIL_ADDRESS)


Logs from idp-process.log: https://pastebin.com/CLwMh4Yx

******** conf/authn/ldap-authn-config.xml remains unchanged from the distribution copy ********

******** attribute-filter.xml ********

<?xml version="1.0" encoding="UTF-8"?>
<AttributeFilterPolicyGroup id="ShibbolethFilterPolicy"
       xmlns="urn:mace:shibboleth:2.0:afp"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="urn:mace:shibboleth:2.0:afp http://shibboleth.net/schema/idp/shibboleth-afp.xsd">

   <AttributeFilterPolicy id="sp-waffles">
       <PolicyRequirementRule xsi:type="Requester" value="https://idp.testshib.org/idp/shibboleth" />

       <AttributeRule attributeID="uid">
           <PermitValueRule xsi:type="ANY" />
       </AttributeRule>

       <AttributeRule attributeID="mail">
           <PermitValueRule xsi:type="ANY" />
       </AttributeRule>

       <AttributeRule attributeID="sn">
           <PermitValueRule xsi:type="ANY" />
       </AttributeRule>

       <AttributeRule attributeID="givenName">
           <PermitValueRule xsi:type="ANY" />
       </AttributeRule>
   </AttributeFilterPolicy>
</AttributeFilterPolicyGroup>

******** ldap.properties ********

idp.authn.LDAP.authenticator                    = bindSearchAuthenticator
idp.authn.LDAP.ldapURL                          = ldap://#########:389
idp.authn.LDAP.useStartTLS                      = false
idp.authn.LDAP.useSSL                           = false
idp.authn.LDAP.baseDN                           = OU=Our Users,DC=ourdomain,DC=com
idp.authn.LDAP.subtreeSearch                    = true
idp.authn.LDAP.userFilter                       = (proxyAddresses=smtp:{user})
idp.authn.LDAP.bindDN                           = ######@ourdomain.com
idp.authn.LDAP.bindDNCredential                 = ##########
idp.attribute.resolver.LDAP.ldapURL             = %{idp.authn.LDAP.ldapURL}
idp.attribute.resolver.LDAP.connectTimeout      = %{idp.authn.LDAP.connectTimeout:PT3S}
idp.attribute.resolver.LDAP.responseTimeout     = %{idp.authn.LDAP.responseTimeout:PT3S}
idp.attribute.resolver.LDAP.baseDN              = %{idp.authn.LDAP.baseDN:undefined}
idp.attribute.resolver.LDAP.bindDN              = %{idp.authn.LDAP.bindDN:undefined}
idp.attribute.resolver.LDAP.bindDNCredential    = %{idp.authn.LDAP.bindDNCredential:undefined}
idp.attribute.resolver.LDAP.useStartTLS         = %{idp.authn.LDAP.useStartTLS:true}
idp.attribute.resolver.LDAP.trustCertificates   = %{idp.authn.LDAP.trustCertificates:undefined}

# I have tried both of the following and suspect this may be where the problem is? AD doesn't typically use uid
#idp.attribute.resolver.LDAP.searchFilter        = (uid=$resolutionContext.principal)
idp.attribute.resolver.LDAP.searchFilter        = (proxyAddresses=smtp:$resolutionContext.principal)



******** attribute-resolver.xml ********



<?xml version="1.0" encoding="UTF-8"?>
<AttributeResolver
       xmlns="urn:mace:shibboleth:2.0:resolver"
       xmlns:sec="urn:mace:shibboleth:2.0:security"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="urn:mace:shibboleth:2.0:resolver http://shibboleth.net/schema/idp/shibboleth-attribute-resolver.xsd
                           urn:mace:shibboleth:2.0:security http://shibboleth.net/schema/idp/shibboleth-security.xsd">

   <!-- ========================================== -->
   <!--      Attribute Definitions                 -->
   <!-- ========================================== -->

   <!-- Schema: Core schema attributes-->

   <AttributeDefinition xsi:type="Simple" id="uid" sourceAttributeID="uid">
       <Dependency ref="LDAP" />
       <AttributeEncoder xsi:type="SAML1String" name="urn:mace:dir:attribute-def:uid" encodeType="false" />
       <AttributeEncoder xsi:type="SAML2String" name="urn:oid:0.9.2342.19200300.100.1.1" friendlyName="uid" encodeType="false" />
   </AttributeDefinition>

   <AttributeDefinition xsi:type="Simple" id="mail" sourceAttributeID="mail">
       <Dependency ref="LDAP" />
       <AttributeEncoder xsi:type="SAML1String" name="urn:mace:dir:attribute-def:mail" encodeType="false" />
       <AttributeEncoder xsi:type="SAML2String" name="urn:oid:0.9.2342.19200300.100.1.3" friendlyName="mail" encodeType="false" />
   </AttributeDefinition>

   <AttributeDefinition xsi:type="Simple" id="homePhone" sourceAttributeID="homePhone">
       <Dependency ref="LDAP" />
       <AttributeEncoder xsi:type="SAML1String" name="urn:mace:dir:attribute-def:homePhone" encodeType="false" />
       <AttributeEncoder xsi:type="SAML2String" name="urn:oid:0.9.2342.19200300.100.1.20" friendlyName="homePhone" encodeType="false" />
   </AttributeDefinition>

   <AttributeDefinition xsi:type="Simple" id="homePostalAddress" sourceAttributeID="homePostalAddress">
       <Dependency ref="LDAP" />
       <AttributeEncoder xsi:type="SAML1String" name="urn:mace:dir:attribute-def:homePostalAddress" encodeType="false" />
       <AttributeEncoder xsi:type="SAML2String" name="urn:oid:0.9.2342.19200300.100.1.39" friendlyName="homePostalAddress" encodeType="false" />
   </AttributeDefinition>

   <AttributeDefinition xsi:type="Simple" id="mobileNumber" sourceAttributeID="mobile">
       <Dependency ref="LDAP" />
       <AttributeEncoder xsi:type="SAML1String" name="urn:mace:dir:attribute-def:mobile" encodeType="false" />
       <AttributeEncoder xsi:type="SAML2String" name="urn:oid:0.9.2342.19200300.100.1.41" friendlyName="mobile" encodeType="false" />
   </AttributeDefinition>

   <AttributeDefinition xsi:type="Simple" id="pagerNumber" sourceAttributeID="pager">
       <Dependency ref="LDAP" />
       <AttributeEncoder xsi:type="SAML1String" name="urn:mace:dir:attribute-def:pager" encodeType="false" />
       <AttributeEncoder xsi:type="SAML2String" name="urn:oid:0.9.2342.19200300.100.1.42" friendlyName="pager" encodeType="false" />
   </AttributeDefinition>

   <AttributeDefinition xsi:type="Simple" id="surname" sourceAttributeID="sn">
       <Dependency ref="LDAP" />
       <AttributeEncoder xsi:type="SAML1String" name="urn:mace:dir:attribute-def:sn" encodeType="false" />
       <AttributeEncoder xsi:type="SAML2String" name="urn:oid:2.5.4.4" friendlyName="sn" encodeType="false" />
   </AttributeDefinition>

   <AttributeDefinition xsi:type="Simple" id="locality" sourceAttributeID="l">
       <Dependency ref="LDAP" />
       <AttributeEncoder xsi:type="SAML1String" name="urn:mace:dir:attribute-def:l" encodeType="false" />
       <AttributeEncoder xsi:type="SAML2String" name="urn:oid:2.5.4.7" friendlyName="l" encodeType="false" />
   </AttributeDefinition>

   <AttributeDefinition xsi:type="Simple" id="stateProvince" sourceAttributeID="st">
       <Dependency ref="LDAP" />
       <AttributeEncoder xsi:type="SAML1String" name="urn:mace:dir:attribute-def:st" encodeType="false" />
       <AttributeEncoder xsi:type="SAML2String" name="urn:oid:2.5.4.8" friendlyName="st" encodeType="false" />
   </AttributeDefinition>

   <AttributeDefinition xsi:type="Simple" id="street" sourceAttributeID="street">
       <Dependency ref="LDAP" />
       <AttributeEncoder xsi:type="SAML1String" name="urn:mace:dir:attribute-def:street" encodeType="false" />
       <AttributeEncoder xsi:type="SAML2String" name="urn:oid:2.5.4.9" friendlyName="street" encodeType="false" />
   </AttributeDefinition>

   <AttributeDefinition xsi:type="Simple" id="organizationName" sourceAttributeID="o">
       <Dependency ref="LDAP" />
       <AttributeEncoder xsi:type="SAML1String" name="urn:mace:dir:attribute-def:o" encodeType="false" />
       <AttributeEncoder xsi:type="SAML2String" name="urn:oid:2.5.4.10" friendlyName="o" encodeType="false" />
   </AttributeDefinition>

   <AttributeDefinition xsi:type="Simple" id="organizationalUnit" sourceAttributeID="ou">
       <Dependency ref="LDAP" />
       <AttributeEncoder xsi:type="SAML1String" name="urn:mace:dir:attribute-def:ou" encodeType="false" />
       <AttributeEncoder xsi:type="SAML2String" name="urn:oid:2.5.4.11" friendlyName="ou" encodeType="false" />
   </AttributeDefinition>

   <AttributeDefinition xsi:type="Simple" id="title" sourceAttributeID="title">
       <Dependency ref="LDAP" />
       <AttributeEncoder xsi:type="SAML1String" name="urn:mace:dir:attribute-def:title" encodeType="false" />
       <AttributeEncoder xsi:type="SAML2String" name="urn:oid:2.5.4.12" friendlyName="title" encodeType="false" />
   </AttributeDefinition>

   <AttributeDefinition xsi:type="Simple" id="postalAddress" sourceAttributeID="postalAddress">
       <Dependency ref="LDAP" />
       <AttributeEncoder xsi:type="SAML1String" name="urn:mace:dir:attribute-def:postalAddress" encodeType="false" />
       <AttributeEncoder xsi:type="SAML2String" name="urn:oid:2.5.4.16" friendlyName="postalAddress" encodeType="false" />
   </AttributeDefinition>

   <AttributeDefinition xsi:type="Simple" id="postalCode" sourceAttributeID="postalCode">
       <Dependency ref="LDAP" />
       <AttributeEncoder xsi:type="SAML1String" name="urn:mace:dir:attribute-def:postalCode" encodeType="false" />
       <AttributeEncoder xsi:type="SAML2String" name="urn:oid:2.5.4.17" friendlyName="postalCode" encodeType="false" />
   </AttributeDefinition>

   <AttributeDefinition xsi:type="Simple" id="postOfficeBox" sourceAttributeID="postOfficeBox">
       <Dependency ref="LDAP" />
       <AttributeEncoder xsi:type="SAML1String" name="urn:mace:dir:attribute-def:postOfficeBox" encodeType="false" />
       <AttributeEncoder xsi:type="SAML2String" name="urn:oid:2.5.4.18" friendlyName="postOfficeBox" encodeType="false" />
   </AttributeDefinition>

   <AttributeDefinition xsi:type="Simple" id="telephoneNumber" sourceAttributeID="telephoneNumber">
       <Dependency ref="LDAP" />
       <AttributeEncoder xsi:type="SAML1String" name="urn:mace:dir:attribute-def:telephoneNumber" encodeType="false" />
       <AttributeEncoder xsi:type="SAML2String" name="urn:oid:2.5.4.20" friendlyName="telephoneNumber" encodeType="false" />
   </AttributeDefinition>

   <AttributeDefinition xsi:type="Simple" id="givenName" sourceAttributeID="givenName">
       <Dependency ref="LDAP" />
       <AttributeEncoder xsi:type="SAML1String" name="urn:mace:dir:attribute-def:givenName" encodeType="false" />
       <AttributeEncoder xsi:type="SAML2String" name="urn:oid:2.5.4.42" friendlyName="givenName" encodeType="false" />
   </AttributeDefinition>

   <AttributeDefinition xsi:type="Simple" id="initials" sourceAttributeID="initials">
       <Dependency ref="LDAP" />
       <AttributeEncoder xsi:type="SAML1String" name="urn:mace:dir:attribute-def:initials" encodeType="false" />
       <AttributeEncoder xsi:type="SAML2String" name="urn:oid:2.5.4.43" friendlyName="initials" encodeType="false" />
   </AttributeDefinition>

   <AttributeDefinition xsi:type="Simple" id="displayName" sourceAttributeID="displayName">
       <Dependency ref="LDAP" />
       <AttributeEncoder xsi:type="SAML1String" name="urn:mace:dir:attribute-def:displayName" encodeType="false" />
       <AttributeEncoder xsi:type="SAML2String" name="urn:oid:2.16.840.1.113730.3.1.241" friendlyName="displayName" encodeType="false" />
   </AttributeDefinition>

   <!-- ========================================== -->
   <!--      Data Connectors                       -->
   <!-- ========================================== -->

   <DataConnector id="LDAP" xsi:type="LDAPDirectory"
       ldapURL="%{idp.attribute.resolver.LDAP.ldapURL}"
       baseDN="%{idp.attribute.resolver.LDAP.baseDN}"
       principal="%{idp.attribute.resolver.LDAP.bindDN}"
       principalCredential="%{idp.attribute.resolver.LDAP.bindDNCredential}"
       useStartTLS="%{idp.attribute.resolver.LDAP.useStartTLS:true}"
       connectTimeout="%{idp.attribute.resolver.LDAP.connectTimeout}"
       responseTimeout="%{idp.attribute.resolver.LDAP.responseTimeout}">
       <FilterTemplate>
           <![CDATA[
               %{idp.attribute.resolver.LDAP.searchFilter}
           ]]>
       </FilterTemplate>
       <ReturnAttributes>%{idp.authn.LDAP.returnAttributes}</ReturnAttributes>
   </DataConnector>

</AttributeResolver>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shibboleth.net/pipermail/users/attachments/20171212/671ec837/attachment-0001.html>


More information about the users mailing list