首页 > 解决方案 > SAML 2.0 中的可审计性

问题描述

SAML 2.0 是否能够存储正在访问我的 API-REST 的所有用户,并且这样我可以跟踪正在进入我的 API 的人?例如,如果我想知道昨天谁访问了我的 Api。

标签: samlsaml-2.0onelogin

解决方案


SAML只是您的用户信息到达的格式。例如,使用示例,以下是用户的表示方式SAML

<saml:AttributeStatement>
      <saml:Attribute Name="uid" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
        <saml:AttributeValue xsi:type="xs:string">test</saml:AttributeValue>
      </saml:Attribute>
      <saml:Attribute Name="mail" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
        <saml:AttributeValue xsi:type="xs:string">test@example.com</saml:AttributeValue>
      </saml:Attribute>
      <saml:Attribute Name="eduPersonAffiliation" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
        <saml:AttributeValue xsi:type="xs:string">users</saml:AttributeValue>
        <saml:AttributeValue xsi:type="xs:string">examplerole1</saml:AttributeValue>
      </saml:Attribute>
    </saml:AttributeStatement>

uid属性将是他们的用户名以及mail属性中的电子邮件地址。eduPersonAffiliation说明他们与组织的关系。在这种情况下,他们是在自己的组织中具有 examplerole1 角色的用户。

SAML除了将其传送到您的 API 之外,不会记录此内容。提取这些属性并从中创建自己的审计系统将由您决定。

许多SAML身份提供者 (IdP) 发布 eduPerson 属性。最新的架构在这里


推荐阅读