金色坐标

关注互联网和IT科技的个人博客

« SAML协议简介和统一认证SOAP接口示例主题搜索引擎(垂直搜索引擎)网页抓取要点 »

统一认证SOAP接口示例—SAML响应格式

下面是统一认证系统SOAP接口,根据应用系统请求生成的SAML响应的实例:

<Response xmlns="urn:oasis:names:tc:SAML:1.0:protocol" xmlns:samlp=
"urn:oasis:names:tc:SAML:1.0:protocol"
InResponseTo="560c2de3-5dea-48c1-9004-6bfaa1daafae"
IssueInstant="2003-10-28T09:21:08Z" MajorVersion="1" MinorVersion="0" Recipient="90" ResponseID="32600595-16fc-49d6-96b8-86e11311cd59">
<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<ds:SignedInfo>
<ds:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315">
</ds:CanonicalizationMethod>
<ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></ds:SignatureMethod>
<ds:Reference URI="">
<ds:Transforms>
<ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></ds:Transform>
</ds:Transforms>
<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></ds:DigestMethod>
<ds:DigestValue>wd8Ga3PRKTfjP95iQyT4yW0RR1s=</ds:DigestValue>
</ds:Reference>
</ds:SignedInfo>
<ds:SignatureValue>EHcl01Z19jMy5ltn5R90ulFXC9qQK658apnP00xl7n5vkRY+9mV3rRSYM1cIY3S06LFIQImY8lGGK/Q6fjl/8w==
</ds:SignatureValue></ds:Signature>

<Status><StatusCode Value="samlp:Success"></StatusCode></Status>

<Assertion xmlns="urn:oasis:names:tc:SAML:1.0:assertion"
AssertionID="e08f2775-ec45-4de5-ac3b-5a6048a7f8fe"
IssueInstant="2003-10-28T09:21:29Z" Issuer="CSDL" MajorVersion="1" MinorVersion="0">
<Conditions NotBefore="2003-10-28T09:21:08Z" NotOnOrAfter="2003-10-28T09:26:08Z"></Conditions>
<AuthenticationStatement AuthenticationInstant="2003-10-28T09:20:25Z" AuthenticationMethod="FORM">
<Subject>
<NameIdentifier>test</NameIdentifier>
</Subject>
<SubjectLocality IPAddress="192.168.0.42"></SubjectLocality>
</AuthenticationStatement>
<AttributeStatement>
<Subject><NameIdentifier>test</NameIdentifier></Subject>
<Attribute AttributeName="roles" AttributeNamespace="roles">
<AttributeValue>role1</AttributeValue>
</Attribute>
</AttributeStatement>
</Assertion>
</Response>

下面分析SAML响应的格式。可以将上述的例子简化为:

< Response>
  <ds:Signature>     </ds:Signature>
  <Status>    </Status>
  <Assertion>
   <Conditions>    </Conditions>
   <AuthenticationStatement>  </AuthenticationStatement>
   <AttributeStatement>   </AttributeStatement>
  </Assertion>
</ Response >

下面对其结构进行解释:

< Response>节点中的Recipient属性指明了接收响应的资源方的标识,InResponseTo属性指明了是对那一条SAML请求的响应。

<ds:Signature>节点是对整个SAML响应文档进行数字签名的。

<Status>用来表示响应的状态,其子节点<StatusCode Value="samlp:Success">表示请求被成功的处理。

随后的<Assertion>节点返回了对该请求处理产生的断言。断言的<Conditions>表明了断言有效的条件。系统要依据它和断言的ID进行重放缓冲,防止重放攻击。

可以看出该断言一共包括两个声明:

1,认证声明<AuthenticationStatement>包含了用户认证的信息, 罗列了用户登录的基本信息,包括认证时间、认证方式、用户标识、认证IP等。

2,属性声明<AttributeStatement>包含了用户在此资源上的角色属性。以返回一个属性的值,它可以是一个集合。




原创文章,如转载请注明:转载自金色坐标 [ http://www.kingxy.com/ ]

本文链接地址:http://www.kingxy.com/archives/44.html
  • quote 1.pireszc
  • 您好 正在做硕士毕业论文 很是头疼 很想请教您一些关于saml的问题 不知可否指点一二 万分感激!
  • 2010-8-11 11:14:38 回复该留言

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

订阅博客

  • 订阅我的博客:订阅我的博客
  • 关注新浪微博:关注新浪微博
  • 关注腾讯微博:关注腾讯微博
  • 通过Google订阅本站
  • 通过鲜果订阅本站
  • 通过电子邮件订阅
  • 本站支持WAP访问

Search

Google

最新评论及回复

最近发表

金色坐标博客——京ICP备09009094号

本站采用创作共用版权协议, 要求署名、非商业用途和保持一致. 转载本站内容必须也遵循“署名-非商业用途-保持一致”的创作共用协议.
KingXY Blog - This site is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 License.