SP под управлением Shibboleth 2.5.6. Для одного конкретного IdP у меня есть следующие сопоставления атрибутов:
<Attribute name="role"
nameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified"
id="role" />
<Attribute name="urn:mace:dir:attribute-def:givenName"
nameFormat="urn:mace:shibboleth:1.0:attributeNamespace:uri"
id="givenName" />
Я получаю сообщение, содержащее:
<AttributeStatement>
<Attribute Name="role" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified">
<AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">Educator</AttributeValue>
</Attribute>
<Attribute Name="urn:mace:dir:attribute-def:givenName" NameFormat="urn:mace:shibboleth:1.0:attributeNamespace:uri">
<AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">intraguest</AttributeValue>
</Attribute>
</AttributeStatement>
Какие журналы:
Shibboleth.AttributeExtractor.XML : creating mapping for Attribute role, Format/Namespace:urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified
Shibboleth.AttributeExtractor.XML : creating mapping for Attribute urn:mace:dir:attribute-def:givenName
...
DEBUG Shibboleth.AttributeDecoder.String [1]: decoding SimpleAttribute (role) from SAML 2 Attribute (role) with 1 value(s)
INFO Shibboleth.AttributeExtractor.XML [1]: skipping unmapped SAML 2.0 Attribute with Name: urn:mace:dir:attribute-def:givenName, Format:urn:mace:shibboleth:1.0:attributeNamespace:uri
Почему givenName
пропускается, когда его имя
и nameFormat
соответствует?
Я отмечаю, что комментарий Format / Namespace
отсутствует в строке журнала «создание сопоставления» для givenName
, но я предполагаю, что ' s, потому что данный nameFormat
соответствует значению по умолчанию.
Обновление:
IdP является источником PingFederate, метаданные которого претендуют на SAML 2. Вот соответствующий отрывок из метаданных:
<md:EntityDescriptor xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata" ID="..." entityID="...">
<md:IDPSSODescriptor protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol">
<saml:Attribute xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" Name="urn:mace:dir:attribute-def:givenName" NameFormat="urn:mace:shibboleth:1.0:attributeNamespace:uri"/>
<saml:Attribute xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" Name="role" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified"/>
</md:IDPSSODescriptor>
</md:EntityDescriptor>
У нас была та же проблема. Очевидно, Shibboleth не может смешивать форматы SAML 1 и SAML 2. Вы должны использовать их следующим образом ( https://wiki.shibboleth.net/confluence/display/SHIB2/NativeSPAddAttribute ):
Итак, проблема в том, что вы получить сообщение SAML 2 с атрибутом в формате SAML 1, который не поддерживается Shibboleth, даже если вы явно укажете Shibboleth использовать формат SAML1 с помощью атрибута nameFormat.
Мы решили проблему, спросив команду PingFederate IdP чтобы отправить нам атрибуты в формате SAML 2 «urn: oasis: names: tc: SAML: 2.0: attrname-format: unspecified» (поскольку это, очевидно, формат, который легко поддерживать в PingFederate). В нашем сопоставлении атрибутов мы не используем атрибут nameFormat, потому что этот формат используется по умолчанию для Shibboleth.
Надеюсь, это поможет вам решить проблему.