Help > Forum > Integração de sites > Início de sessão único - SAML

Início de sessão único - SAML

O Security Assertion Markup Language (SAML) é um padrão baseado em XML que permite que você comunique decisões de autenticação entre um serviço e outro. O Website Toolbox suporta SAML para início de sessão único num fórum do Website Toolbox a partir de um portal empresarial ou de um fornecedor de identidade para clientes que tenham adquirido um plano de subscrição do fórum Standard ou Premium.

Um provedor de identidade é um provedor confiável que permite que você use o logon único para acessar outros sites. Um provedor de serviços é um site que hospeda aplicativos (ou seja, Website Toolbox).

Siga as instruções abaixo para integrar o SAML SSO ao seu site:

  1. Estabeleça um provedor de identidade SAML e colete informações de seu provedor de identidade. Este é o provedor que enviará solicitações de logon único para a Website Toolbox.
    1. A versão do SAML que o idP usa (1.1 ou 2.0). Nós suportamos apenas SAML 2.0.
    2. O ID da entidade do IDP (também conhecido como emitente).
    3. Arquivo XML de metadados IDP.
  2. Talvez seja necessário usar os seguintes valores para configurar o SAML SSO no Provedor de Identidade do seu site.
    1. Id da entidade - https://USERNAME.websitetoolbox.com/sp
    2. URL ACS - https://USERNAME.websitetoolbox.com/saml/module.php/saml/sp/saml2-acs.php/USERNAME (Assertion Consumer Service)
    3. Tipo de Assunto - Nome de usuário, ID de federação ou ID de usuário do usuário. (Especifica qual campo define a identidade do usuário para o aplicativo).
    4. Formato de ID de Nome - Os formatos de ID de Nome permitidos são:
      urn:oasis:names:tc:SAML:2.0:nameid-format:persistent
      urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress
      urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified.
  3. Adicione os seguintes URLs à caixa de diálogo Configurações SSO para configurar o Login e Logout iniciados pelo Provedor de Serviços.
    1. Página de login - URL da página de login do seu site.
    2. Página Fazer logout - URL da página de logout do seu site.
  4. Forneça seu arquivo de metadados do provedor de identidade para nossa suporte ao cliente para configuração do SAML.
  5. Você precisa definir os seguintes atributos de usuário para usuários que fazem login via SAML:

    AtributoDescrição
    userId ID de usuário exclusivo do usuário. (Obrigatório)
    nome de usuário Nome de usuário do usuário. (Obrigatório)
    e-mail Endereço de e-mail do usuário. (Obrigatório)
    apikey Chave de API do Fórum da Caixa de Ferramentas do Website. (Obrigatório) Você pode obter a chave da API Aqui.
    apelido O apelido do usuário. (Obrigatório se você estiver usando o Salesforce idP)
    firstName O primeiro nome do usuário. (Opcional)
    lastName O sobrenome do usuário. (Opcional)

    Defina esses atributos usando uma instrução de atributo em sua asserção SAML. Exemplo:

    <saml:AttributeStatement xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">
    	<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">00528000000Seyz</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@gmail.com</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">0XrYQtH5ZsHf58QtH5Zs8NKRMdKVJFyr8i5hpOO</saml:AttributeValue></saml:Attribute>
    </saml:AttributeStatement>
O Website Toolbox espera uma afirmação SAML semelhante a esta:
<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
 h6Oq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FMAMBAf8wgcoGA1UdIwSBwjCBv4AUJNOcvejQ
 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>
   <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/+bscnLQQ0+0ls15JszoV798NUY0UgI
 k/UGEg1nEVfiQabCZrW/ZwqetwXmCuf1CmF2lw==</ds:SignatureValue>
       <ds:KeyInfo>
         <ds:X509Data>
           <ds:X509Certificate>MIIErDCCA5SgAwIBAgIOAU8B/mTiAAAAAEQfI+YwDQYJKoZIhvcNAQELBQAwgZAxKDAmBgNVBAMM
 H1NlbGZTaWduZWRDZXJ0XzA2QXVnMjAxNV8wNzUxMzIxGDAWBgNVBAsMDzAwRDI4MDAwMDAwV3ZM
 VTEXMBUGA1UECgwOU2FsZXNmb3JjZS5jb20xFjAUBgNVBAcMDVNhbiBGcmFuY2lzY28xCzAJBgNV
 BAgMAk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BLS6O9Eb86P4FtBiR4YPoGAUn2O48jnXrP
 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>

Aqui estão alguns links relacionados à documentação do SAML2.0, que podem ajudá-lo a entender a configuração do SAML2.0 SSO:

Observe que também oferecemos suporte outros métodos de logon único que pode ser mais fácil de configurar.


If you still need help, please contact us.