Help

Help > Forum > 網站集成 > 单点登录-SAML

单点登录-SAML

安全断言标记语言 (SAML) 是一种基于 XML 的标准,允许您在一项服务与另一项服务之间传达身份验证决策。对于购买了专业论坛订阅套餐的客户,Website Toolbox支持 SAML 从企业门户网站或身份提供商单点登录Website Toolbox论坛。

身份提供商是可信的提供商,它使您能够使用单点登录来访问其他网站。服务提供商是托管应用程序(即:Website Toolbox)的网站。

请注意,我们也支持 其他单点登录方法 这可能更容易设置。

设置 SAML SSO

请按照以下说明将 SAML SSO 集成到您的网站中:

  1. 建立 SAML 身份提供商并从您的身份提供商那里收集信息。该提供商将向Website Toolbox发送单点登录请求。
    1. IdP 使用的 SAML 版本(1.1 或 2.0)。我们仅支持 SAML 2.0。
    2. IDP(也称为发行者)的实体 ID。
    3. IDP 元数据 XML 文件。
  2. 您可能需要使用以下值在您网站的身份提供商中设置 SAML SSO。 (将用户名替换为您的Website Toolbox用户名。)
    1. 实体 ID-https://USERNAME.websitetoolbox.com/sp
    2. ACS 网址-https://USERNAME.websitetoolbox.com/saml/module.php/saml/sp/saml2-acs.php/USERNAME(断言消费者服务)
    3. 主题类型-用户的用户名、联盟 ID 或用户 ID。(它指定哪个字段定义了应用程序的用户身份)。
    4. 名称 ID 格式-允许的 nameID 格式为:
      urn: Oasis: names: tc: saml: 2.0: nameID 格式:Persistent
      urn: Oasis: names: tc: saml: 1.1: nameID 格式:电子邮件地址
      urn: Oasis: names: tc: saml: 1.1: nameID 格式:未指定。
  3. 在中指定您网站的登录、注销和注册页面网址 SSO 设置 设置服务提供商启动的登录和注销。

    你可以使用下面的网址作为登录和注册页面的网址,让它在登录后自动重定向到论坛。 (将用户名替换为您的Website Toolbox用户名。)

    https://USERNAME.websitetoolbox.com/saml/module.php/core/as_login.php?AuthId=USERNAME&ReturnTo=/saml/saml.php?authSource=USERNAME

  4. 向我们提供您的身份提供商元数据文件 客户支持 团队负责配置 SAML。
  5. 您必须为通过 SAML 登录的用户设置以下用户属性:

    属性
    描述
    用户 ID
    用户的唯一用户 ID。(必填)
    用户名
    用户的用户名。(必填)
    电子邮件
    用户的电子邮件地址。(必填)
    apikey
    Website Toolbox论坛的 API 密钥。(必填)你可以获取 API 密钥 这里
    昵称
    用户的昵称。(如果您使用的是 Salesforce IdP,则为必填项)
    名字
    用户的名字。(可选)
    姓氏
    用户的姓氏。(可选)

    您可以在 SAML 断言中使用属性语句设置这些属性。示例:

    
     
     00528000000seyz
     
     NsrivaStava
     
     neeraj@gmail.com
     
     0xryqth5zshf58qth5zs8nkrmdkvjfyr8i5Hpoo
    

示例 SAML 断言

Website Toolbox需要一个如下所示的 SAML 断言:
<samlp:Response xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" Destination="http://USERNAME.websitetoolbox.com/saml/module.php/saml/sp/saml2-acs.php/default-sp" ID="_87fcab9d9410312049f835674a7e65d41466607023109" IssueInstant="2016-06-22T14:50:23.109Z" Version="2.0">
   <saml:Issuer xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity">https://abc.my.salesforce.com</saml:Issuer>
   <ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
     <ds:SignedInfo>
       <ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
       <ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
       <ds:Reference URI="#_87fcab9d9410312049f835674a7e65d41466607023109">
         <ds:Transforms>
           <ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
           <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
             <ec:InclusiveNamespaces xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#" PrefixList="ds saml samlp xs xsi"/>
           </ds:Transform>
         </ds:Transforms>
         <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
         <ds:DigestValue>1N29VuJQuNw0bglPXTYSw6L5lgw=</ds:DigestValue>
       </ds:Reference>
     </ds:SignedInfo>
     <ds:SignatureValue>hYyGfKIP+7LLoJI2TKbPLTBfDtiMoDKGmEG4fh2G9Qk0nJNAcjJmiv/9X0n7MZQVvyQ+h38C27Jp
 Rxwl1OwdGp6snec0pHrH1GeGt3TB3Cj6MeGAgA8LvWZpusTChwR/LcIPW9uAkNSg40SEKK8aFjYp
 4rAM0BcGqfs2QSrcloSGfBsGz5VJw9NIavoudKMDbjvGTD21T3k2VFoSmFZshChgfBD3Zb4jC5IL
 7BAOSkLiv/NwLeHjQtizltv5tFNz5eEPryjxgMIynMXI/qJrGrr0ZbQ6EOY4DpPFRkjR+y369ueU
 h6Oq930IoVexF3oGb0fahWjvESQln6VOtXWZKQ==</ds:SignatureValue>
     <ds:KeyInfo>
       <ds:X509Data>
         <ds:X509Certificate>MIIErDCCA5SgAwIBAgIOAU8B/mTiAAAAAEQfI+YwDQYJKoZIhvcNAQELBQAwgZAxKDAmBgNVBAMM
 H1NlbGZTaWduZWRDZXJ0XzA2QXVnMjAxNV8wNzUxMzIxGDAWBgNVBAsMDzAwRDI4MDAwMDAwV3ZM
 VTEXMBUGA1UECgwOU2FsZXNmb3JjZS5jb20xFjAUBgNVBAcMDVNhbiBGcmFuY2lzY28xCzAJBgNV
 BAgMAkNBMQwwCgYDVQQGEwNVU0EwHhcNMTUwODA2MDc1MTMzWhcNMTcwODA2MDAwMDAwWjCBkDEo
 MCYGA1UEAwwfU2VsZlNpZ25lZENlcnRfMDZBdWcyMDE1XzA3NTEzMjEYMBYGA1UECwwPMDBEMjgw
 MDAwMDBXdkxVddfdfdfDVQQKDA5TYWxlc2ZvcmNlLmNvbTEWMBQGA1UEBwwNU2FuIEZyYW5jaXNj
 bzELMAkGA1UECAwCQ0ExDDAKBgNVBAYTA1VTQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
 ggEBAKAceZ4/GgiElg3OMOSv6cphKL3czcuIaenqVuKjbhXxEKzL7UwR7ZEU48GnSDG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   </ds:Signature>
   <samlp:Status>
     <samlp:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success"/>
   </samlp:Status>
   <saml:Assertion xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" ID="_c111e599082e09ec1e67f2c4c5fd53f01466607023109" IssueInstant="2016-06-22T14:50:23.109Z" Version="2.0">
     <saml:Issuer Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity">https://neeraj3-dev-ed.my.salesforce.com</saml:Issuer>
     <ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
       <ds:SignedInfo>
         <ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
         <ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
         <ds:Reference URI="#_c111e599082e09ec1e67f2c4c5fd53f01466607023109">
           <ds:Transforms>
             <ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
             <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
               <ec:InclusiveNamespaces xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#" PrefixList="ds saml xs xsi"/>
             </ds:Transform>
           </ds:Transforms>
           <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
           <ds:DigestValue>VWSipDpvJ5SpsmgrjL+7vrlIsCM=</ds:DigestValue>
         </ds:Reference>
       </ds:SignedInfo>
       <ds:SignatureValue>CfehXdklPiozqvyM8igaXQjGntyWdZPkqt1LuQDV2lVbNnR7b+hD/2zQ7oQRmAyl4/SRPMYdwU7+
 nuYINyYyIEmbVPWkxLoKrJYNWqadVTSJcY4AHmqk06xGzQ49Z/7KZpRWBGvrfD5gFkymIB00DUPs
 PqQn/fLi/9tcBk9SVOmMupPANnxpHkZnJ4sy54PYhj4U3SjYkGDLx/FXXS6a4D7wjR2FqZ5ReZi7
 xwB2fUNXYnvf2LsSQ9ubGZLFNd5u1MecwRoGJj74ZYly1/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 nL3o0HiBU0eH0XyChY7VvQcFMA8GA1UdEwEB/wQFMAMBAf8wgcoGA1UdIwSBwjCBv4AUJNOcvejQ
 eIFTR4fRfIKFjtW9BwWhgZakgZMwgZAxKDAmBgNVBAMMH1NlbGZTaWduZWRDZXJ0XzA2QXVnMjAx
 NV8wNzUxMzIxGDAWBgNVBAsMDzAwRDI4MDAwMDAwV3ZMVTEXMBUGA1UECgwOU2FsZXNmb3JjZS5j
 b20xFjAUBgNVBAcMDVNhbiBGcmFuY2lzY28xCzAJBgNVBAgMAkNBMQwwCgYDVQQGEwNVU0GCDgFP
 Af5k4gAAAABEHyPmMA0GCSqGSIb3DQEBCwUAA4IBAQBLS6O9Eb86P4FtBiR4YPoGAUn2O48jnXrP
 oIx4677l5zilyt3Wt0KCuMfZZ0aCMzP8Q09XVDuKPYJcNb3zki8+jUw8Uo4elKZ9KPQC3Z2mKmro
 /59qs11p6c1Yrr+k2qtNX/gM4/j1B6shcUctqQPsP763b14vrzKfUkAzDkZ/feuCkey3+87Cucdg
 WnvZoPirfvPYBcYSJkxygUDcv4bPM7y81AnIxZFqrFDqECoicny/On9ZskzwHdN9PnsiWP4N/LqT
 OX3dospwsHrxXCClSi4Ua193vXyDPL6F8UCaUsBr6IzuYunXVcioEHWF5cWBueERSAH+8C/wLjxx
 a9jH</ds:X509Certificate>
         </ds:X509Data>
       </ds:KeyInfo>
     </ds:Signature>
     <saml:Subject>
       <saml:NameID Format="urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified">nSrivastava</saml:NameID>
       <saml:SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer">
         <saml:SubjectConfirmationData NotOnOrAfter="2016-06-22T14:55:23.110Z" Recipient="http://USERNAME.websitetoolbox/saml/module.php/saml/sp/saml2-acs.php/default-sp"/>
       </saml:SubjectConfirmation>
     </saml:Subject>
     <saml:Conditions NotBefore="2016-06-22T14:49:53.110Z" NotOnOrAfter="2016-06-22T14:55:23.110Z">
       <saml:AudienceRestriction>
         <saml:Audience>https://USERNAME.websitetoolbox/sp</saml:Audience>
       </saml:AudienceRestriction>
     </saml:Conditions>
     <saml:AuthnStatement AuthnInstant="2016-06-22T14:50:23.110Z">
       <saml:AuthnContext>
         <saml:AuthnContextClassRef>urn:oasis:names:tc:SAML:2.0:ac:classes:unspecified</saml:AuthnContextClassRef>
       </saml:AuthnContext>
     </saml:AuthnStatement>
     <saml:AttributeStatement>
       <saml:Attribute Name="userId" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified">
         <saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:anyType">00528000000sgQZ</saml:AttributeValue>
       </saml:Attribute>
       <saml:Attribute Name="username" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified">
         <saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:anyType">nSrivastava</saml:AttributeValue>
       </saml:Attribute>
       <saml:Attribute Name="email" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified">
         <saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:anyType">neeraj@websitetoolbox.com</saml:AttributeValue>
       </saml:Attribute>
       <saml:Attribute Name="is_portal_user" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified">
         <saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:anyType">false</saml:AttributeValue>
       </saml:Attribute>
       <saml:Attribute Name="apikey" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified">
         <saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:anyType">uJWAd1W9Q99sdk8vj3ujZqd3e4jJ0PTLLrdUSlkNVf</saml:AttributeValue>
       </saml:Attribute>
       <saml:Attribute Name="nickName" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified">
         <saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:anyType">neerajs</saml:AttributeValue>
       </saml:Attribute>
       <saml:Attribute Name="lastName" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified">
         <saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:anyType">neeraj</saml:AttributeValue>
       </saml:Attribute>
       <saml:Attribute Name="firstName" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified">
         <saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:anyType">srivastava</saml:AttributeValue>
       </saml:Attribute>
     </saml:AttributeStatement>
   </saml:Assertion>
 </samlp:Response>

SAML 2.0 资源

以下是一些与 SAML2.0 文档相关的链接,这些链接可能有助于你理解 SAML2.0 SSO 设置:


If you still need help, please contact us.