使用 Shibboleth (v3) 作为 SP 时,是否可以将属性值映射到 attribute-map.xml 中?

When using Shibboleth (v3) as SP , can I map the attribute value in attribute-map.xml?

在此设置中,OKTA 是 IdP,而 Shibboleth 是 SP。 OKTA 正在传递属性 'roles',例如 idp_dev_SLAN_Power、idp_dev_SLAN_Admin、idp_dev_SLAN_account 等

我想知道当 'idp_dev_SLAN_' 使用此属性时是否可以去掉它。

这是我在当前属性中看到的-map.xml。

<Attribute id="roles" name="roles" nameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified" />

我觉得我可以用 AttributeDecoder 做点什么。有什么想法吗??

我认为您可能正在寻找 Transform 类型的 AttributeResolver,其中:

applies one or more regular expressions to an input attribute, either replacing its values, or generating new attributes. -- from the Shibboleth Wiki

举个例子:

<AttributeResolver type="Transform" source="displayName">
    <Regex match="^(.+) (.+)$" dest="givenName"></Regex>
    <Regex match="^(.+) (.+)$" dest="sn"></Regex>
    <Regex match="^(.+) (.+)$">, </Regex>
</AttributeResolver>

displayName 转换为两个属性 givenNamesn。但我敢肯定,您可以构建一个正则表达式来获取 idp_dev_SLAN_ 各种入站元素,并将它们映射到您想要的 1 个或多个属性。