尝试通过sso访问nextcloud时出现错误

时间:2019-05-28 12:53:40

标签: single-sign-on saml adfs windows-server-2016 nextcloud

我对SAMLRequest无法通过nextcloud进行身份验证有疑问

<samlp:Response ID="_7b0ef094-ae04-4d2c-a7d1-e9d5e698c278"
                Version="2.0"
                IssueInstant="2019-05-28T12:19:07.704Z"
                Destination="https://192.168.1.136/index.php/apps/user_saml/saml/acs"
                Consent="urn:oasis:names:tc:SAML:2.0:consent:unspecified"
                xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol">
  <Issuer xmlns="urn:oasis:names:tc:SAML:2.0:assertion">http://WindowsServer19.server.net/adfs/services/trust</Issuer>
  <samlp:Status>
    <samlp:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success" /></samlp:Status>
  <Assertion ID="_3acf9e24-2f34-47bf-82fb-97f6d11ab652"
             IssueInstant="2019-05-28T12:19:07.703Z"
             Version="2.0"
             xmlns="urn:oasis:names:tc:SAML:2.0:assertion">
    <Issuer>http://WindowsServer19.server.net/adfs/services/trust</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="#_3acf9e24-2f34-47bf-82fb-97f6d11ab652">
          <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#" /></ds:Transforms>
          <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
          <ds:DigestValue>0frZvK2y9o8WTDfpB3rBlK+82W4=</ds:DigestValue>
        </ds:Reference>
      </ds:SignedInfo>
      <ds:SignatureValue>
s4NAgv4ucV5xM6Ig+GsNunpNo5whkJljUec9KtNh00UbRZJ3q2KdzNQ3ZxhpvYudTDqlgzwnenaPmZIcpmgzuqaIiHTStBWUgafZDljZ4/WnQ8SRslMBgRNtuh3NU8qh+0Hgr3k+ngZc1YvlACy+sPeoBxZoFKTC+cwXVeezdlTnPW+IbZ2T1xeLmjz42oelqrnGbsnu6btNgTHzij302YCsbnlKe6wAEw9CvjFCtWPW1dV9iL6FLYkJfPporG9D7FkW+nZoYa8SHns8VRFM97sBKSBcX/csneJiX+7b+hZttw+MPsXmXBgXiU8D0boRjqKByv51fhlhLpKl3HRZZg==
</ds:SignatureValue>
      <KeyInfo
      xmlns="http://www.w3.org/2000/09/xmldsig#">
        <ds:X509Data>
          <ds:X509Certificate>
MIIC8DCCAdigAwIBAgIQMCGuwW//8oZPRuZYDplwVTANBgkqhkiG9w0BAQsFADA0MTIwMAYDVQQDEylBREZTIFNpZ25pbmcgLSBXaW5kb3dzU2VydmVyMTkuc2VydmVyLm5ldDAeFw0xOTA1MjMwMTM1MjJaFw0yMDA1MjIwMTM1MjJaMDQxMjAwBgNVBAMTKUFERlMgU2lnbmluZyAtIFdpbmRvd3NTZXJ2ZXIxOS5zZXJ2ZXIubmV0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA7VQR25k7qgmSYMhh40HYEdaki0Itff0QfjpABaNLJJYLB51ikpK/PctqXDy2StJqo4ai3wcrM2xjcLKm7pOGpNYYF2Brdf8ae3i+gjh3Ej6vDYWs/YWve2yZarBkUxTSFlCLsUACIu5nuo7JmVU9ptPcmcKqEZamU1U04qt6RJzxKvLOdFa4nT2Nx1jM8lGyo+x4oJ0agaSORURdQQVSfIJMUuEXWufp0qeCRt3KrQHf6NzJYGvDCdF6bu5lsrXma+nEIxvs88qg7P15ntA+HTdxut3M9vLm+P2nvZMfxU+BKScBWpBfKDAkABF3PibCjnlr0pJ0ZUwPGsya180NAQIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQAl1f4+rQ3jG+8TfTNtnT/VX8DgXLCop8yrypU/i5AHeS9Xwmi2vqPwEkJQLd84ictIVU43NxtQPvj9RT6IjrwSaDqQcwVOcL0ectlp4cy9DsJsGfMPc3LczX6n07dRweCibRT7+aOGUNuBAi5Qwa63e68DEaHbg+hZkAd0G5gfVLvuKLWcGNUhdGAyHSUCZEXKNeWAVcpeL0JQeEAdPoTR1LA78RUW5PH/VMiEwXrB22T535m3z6YoPyrrWQnDBcXWJ5rIHtJPT58sB3VVHnV2VjNSBH+hS5fFOQ8pABmW+Z5ajpfy2DxdhtTaLt0hXuLpFon7b7/5XJI8ut57yG0E
</ds:X509Certificate>
        </ds:X509Data>
        </KeyInfo>
    </ds:Signature>
    <Subject>
      <NameID>Administrator</NameID>
      <SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer">
        <SubjectConfirmationData NotOnOrAfter="2019-05-28T12:24:07.704Z"
                                 Recipient="https://192.168.1.136/index.php/apps/user_saml/saml/acs" />
      </SubjectConfirmation>
    </Subject>
    <Conditions NotBefore="2019-05-28T12:19:07.702Z"
                NotOnOrAfter="2019-05-28T13:19:07.702Z">
      <AudienceRestriction>
        <Audience>https://192.168.1.136/index.php/apps/user_saml/saml/metadata</Audience>
      </AudienceRestriction>
    </Conditions>
    <AttributeStatement>
      <Attribute Name="http://schemas.microsoft.com/2012/12/certificatecontext/field/issuername">
        <AttributeValue>Aleksandar</AttributeValue>
      </Attribute>
      <Attribute Name="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname">
        <AttributeValue>Andric</AttributeValue>
      </Attribute>
      <Attribute Name="sAMAccountName">
        <AttributeValue>Administrator</AttributeValue>
      </Attribute>
    </AttributeStatement>
    <AuthnStatement AuthnInstant="2019-05-28T12:19:07.675Z"
                    SessionIndex="_3acf9e24-2f34-47bf-82fb-97f6d11ab652">
      <AuthnContext>
        <AuthnContextClassRef>urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport</AuthnContextClassRef>
      </AuthnContext>
    </AuthnStatement>
  </Assertion>
</samlp:Response>

我正在使用ADFS作为身份提供者,并使用nextcloud作为服务提供者,但我无法让它们工作2周。当我单击nextcloud http://prntscr.com/nuevag上的sso&saml按钮时,会发生此错误,并且在删除SAMLRequest和RelayState查询参数并删除co​​okie登录页面后会显示http://prntscr.com/nuez9s,并且在登录“未配置帐户”后出现错误http://prntscr.com/nuf01w。日志文件显示http://prntscr.com/nuf0qj,但是在ADFS中,URL是使用https:// http://prntscr.com/nuf11w设置的。你有什么想法如何使这项工作。非常感谢你!

1 个答案:

答案 0 :(得分:0)

您需要跟踪SAML请求。 ADFS可能不知道SAML AuthnRequest的Issuer,或者可能无法验证SAML AuthnRequest的签名(如果已进行数字签名)。

https://prnt.sc/nuez9s中所示的由IdP发起的SSO是完全不同的流程,其中,IdP仅发送SAML响应,没有SAML AuthnRequest。

ADFS事件日志实际上会显示(有时也以某种神秘的方式)为什么无法处理SAML AuthnRequest。