如何在SP元数据中配置自定义属性

时间:2014-04-28 07:19:02

标签: single-sign-on saml saml-2.0

我开始知道,在任何SSO解决方案中,如果SP需要任何其他属性,它可以使用 AttributeConsumingService 参数在元数据中发布它们。现在可以添加所需的属性,如下所示:

<md:AttributeConsumingService index="0"
xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata"
xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">
<md:ServiceName xml:lang="en">ABC</md:ServiceName>
<md:ServiceDescription xml:lang="en">ABC</md:ServiceDescription>
<md:RequestedAttribute isRequired="true"
NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri"
Name="urn:oid:2.5.4.42"
FriendlyName="FirstName"/>
</md:AttributeConsumingService>

现在,如果我想在我的SP元数据中添加自定义属性,让我们说“用户”的“角色”,我该如何将其添加到元数据中?我的意思是,它的名称是什么(这是我无法找到的!),NameFormat(它是urn:oasis:names:tc:SAML:2.0:attrname-format:uri?)和FriendlyName(我能给出吗?)它在这里作为“角色”?)。我在SAML2Core文档中找不到任何与此相关的内容。

请提出任何建议!

谢谢,

Abhilash

1 个答案:

答案 0 :(得分:5)

没有通用的答案,因为它取决于您使用的IDP /联合以及它支持的内容。

通常,友好名称只是属性的人类可读标识符,值可以自由定义。

NameFormat和Name是根据IDP使用的属性配置文件定义的(例如,基本配置文件,X.500 / LDAP配置文件,...)。预期值可在SAML 2.0 profiles document第8章中找到。

你可以找到一个例子,说明如何在实践中使用它,例如他们documentation中的共同联盟。