当前位置: 首页 > 知识库问答 >
问题:

OpenAm(作为 IdP):SSO 登录返回 NoAuthnContext(无法使用 SSO 登录)

翟淇
2023-03-14

以下是 IdP 在 OpenAm 的元html" target="_blank">数据文件

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<EntityDescriptor entityID="http://myidp.com/openam" xmlns="urn:oasis:names:tc:SAML:2.0:metadata">
    <IDPSSODescriptor WantAuthnRequestsSigned="false" protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol">
        <KeyDescriptor use="signing">
            <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
                <ds:X509Data>
                    <ds:X509Certificate>
MIICQD.....0Y0Q==
                    </ds:X509Certificate>
                </ds:X509Data>
            </ds:KeyInfo>
        </KeyDescriptor>
        <ArtifactResolutionService index="0" isDefault="true" Binding="urn:oasis:names:tc:SAML:2.0:bindings:SOAP" Location="http://myidp.com/openam/ArtifactResolver/metaAlias/idp"/>
        <SingleLogoutService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect" Location="http://myidp.com/openam/IDPSloRedirect/metaAlias/idp" ResponseLocation="http://myidp.com/openam/IDPSloRedirect/metaAlias/idp"/>
        <SingleLogoutService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="http://myidp.com/openam/IDPSloPOST/metaAlias/idp" ResponseLocation="http://myidp.com/openam/IDPSloPOST/metaAlias/idp"/>
        <SingleLogoutService Binding="urn:oasis:names:tc:SAML:2.0:bindings:SOAP" Location="http://myidp.com/openam/IDPSloSoap/metaAlias/idp"/>
        <ManageNameIDService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect" Location="http://myidp.com/openam/IDPMniRedirect/metaAlias/idp" ResponseLocation="http://myidp.com/openam/IDPMniRedirect/metaAlias/idp"/>
        <ManageNameIDService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="http://myidp.com/openam/IDPMniPOST/metaAlias/idp" ResponseLocation="http://myidp.com/openam/IDPMniPOST/metaAlias/idp"/>
        <ManageNameIDService Binding="urn:oasis:names:tc:SAML:2.0:bindings:SOAP" Location="http://myidp.com/openam/IDPMniSoap/metaAlias/idp"/>
        <NameIDFormat>urn:oasis:names:tc:SAML:2.0:nameid-format:persistent</NameIDFormat>
        <NameIDFormat>urn:oasis:names:tc:SAML:2.0:nameid-format:transient</NameIDFormat>
        <NameIDFormat>urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress</NameIDFormat>
        <NameIDFormat>urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified</NameIDFormat>
        <NameIDFormat>urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName</NameIDFormat>
        <NameIDFormat>urn:oasis:names:tc:SAML:2.0:nameid-format:kerberos</NameIDFormat>
        <NameIDFormat>urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName</NameIDFormat>
        <SingleSignOnService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect" Location="http://myidp.com/openam/SSORedirect/metaAlias/idp"/>
        <SingleSignOnService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="http://myidp.com/openam/SSOPOST/metaAlias/idp"/>
        <SingleSignOnService Binding="urn:oasis:names:tc:SAML:2.0:bindings:SOAP" Location="http://myidp.com/openam/SSOSoap/metaAlias/idp"/>
        <NameIDMappingService Binding="urn:oasis:names:tc:SAML:2.0:bindings:SOAP" Location="http://myidp.com/openam/NIMSoap/metaAlias/idp"/>
        <AssertionIDRequestService Binding="urn:oasis:names:tc:SAML:2.0:bindings:SOAP" Location="http://myidp.com/openam/AIDReqSoap/IDPRole/metaAlias/idp"/>
        <AssertionIDRequestService Binding="urn:oasis:names:tc:SAML:2.0:bindings:URI" Location="http://myidp.com/openam/AIDReqUri/IDPRole/metaAlias/idp"/>
    </IDPSSODescriptor>
</EntityDescriptor>

SP位于:http://mysp.com/

可以发布SAML响应的SP的验证url位于:http://mysp.com/login

以下请求适用于 SSO 登录:http://myidp.com/openam/idpssoinit?metaAlias=/idp

当我发布 SAML 请求以 http://myidp.com/openam/SSOPOST/metaAlias/idp 它返回以下 xml

<?xml version="1.0" ?>
<samlp:Response ID="s2ffea3d194a0d2587fd0cfc9cc8c57fa4a9414159" InResponseTo="_ad466c99-c8b6-4fbf-96c9-922dffc3ea22" IssueInstant="2013-05-03T07:22:34Z" Version="2.0" xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol">
  <saml:Issuer xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">
    http://myidp.com/openam
  </saml:Issuer>
  <samlp:Status xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol">
    <samlp:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Requester" xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol">
      <samlp:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:NoAuthnContext" xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol">
      </samlp:StatusCode>
    </samlp:StatusCode>
  </samlp:Status>
</samlp:Response>

我发布的SAML请求是以下xml的base 64编码版本

<?xml version="1.0" ?>
<samlp:AuthnRequest AssertionConsumerServiceURL="http://mysp.com/login" ID="_ad466c99-c8b6-4fbf-96c9-922dffc3ea22" IssueInstant="2013-05-03T12:35:42" ProtocolBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Version="2.0" xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol">
  <saml:Issuer xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">
    mysp.com
  </saml:Issuer>
  <samlp:NameIDPolicy AllowCreate="true" Format="urn:oasis:names:tc:SAML:2.0:nameid-format:unspecified"/>
  <samlp:RequestedAuthnContext Comparison="exact"/>
  <saml:AuthnContextClassRef xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">
    urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport
  </saml:AuthnContextClassRef>
</samlp:AuthnRequest>

因为它在第一种情况下工作,所以很可能是SAML请求的一些问题。是否有任何参数存在于第一个请求中,但不存在于第二个请求中?

共有1个答案

商正诚
2023-03-14

AuthnContextClassRef应在RequestedAuthnContext内。您的请求应该如下所示。

<?xml version="1.0" ?>
<samlp:AuthnRequest AssertionConsumerServiceURL="http://mysp.com/login" ID="_ad466c99-c8b6-4fbf-96c9-922dffc3ea22" IssueInstant="2013-05-03T12:35:42" ProtocolBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Version="2.0" xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol">
    <saml:Issuer xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">
        mysp.com
    </saml:Issuer>    
    <samlp:NameIDPolicy AllowCreate="true" Format="urn:oasis:names:tc:SAML:2.0:nameid-format:unspecified"/>
    <samlp:RequestedAuthnContext Comparison="exact">
        <saml:AuthnContextClassRef xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">
            urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport
        </saml:AuthnContextClassRef>
    </samlp:RequestedAuthnContext>
</samlp:AuthnRequest>
 类似资料:
  • 我通过以下步骤在Azure广告中创建了应用程序: 1-登录到Azure AD,单击应用程序选项卡,添加按钮。 2-选择"添加我的组织正在开发的应用程序"。 3-选择“Web应用程序和/或Web api”。 4-登录url“给出”https://mywebapplication.com/“应用程序内ID URI插入任意随机url。 5-创建应用程序后,转到“配置”选项卡,并将url回复为“https

  • 我已将Websphere for SSO配置为具有LDAP安全性。 它配置正确,工作正常。我损坏了一些东西,无法恢复。 系统抛出以下错误,您能帮助我可能犯了什么错误吗? SECJ0336E:身份验证失败的用户webuser2,因为以下异常com.ibm.ws.security.registry.unix.Unix注册例外在com.ibm.ws.security.registry.unix.Unix

  • 问题内容: 我想使用Django为我们当前使用的多个应用程序实现单一登录(SSO)。如何使用Django实现SSO?是否有可用于实施SSO的Django软件包? 请帮忙谢谢 问题答案: 我们正在使用OpenAM。 http://forgerock.com/openam.html OpenAM Cookie表示用户已通过身份验证。 为此的身份验证后端非常简单。少于50行代码。 https://doc

  • 本文向大家介绍在SAPUI5中使用SSO登录凭单,包括了在SAPUI5中使用SSO登录凭单的使用技巧和注意事项,需要的朋友参考一下 当代理具有SSO令牌时,应使用SET-COOKIE标头将SSO令牌传递给客户端。 示例 它应从代理服务器传递到客户端浏览器,并且域名必须更改为代理服务器,如下所示: 下次您的浏览器调用代理时,它将在请求标头中包含会话cookie,如下所示。代理将从HTTP请求标头读取

  • 我已经配置了OpenAM IdP和SP。我正在纠结于IdP发起的SSO URL和SP发起的SSO URL。我使用以下格式的IdP发起的单点登录网址。但是我得到错误< code >服务提供商ID为空。 http://testtestidam.com:8080/openam/idpssoinit?metaAlias=/realm1/idp 任何人都可以帮忙吗?

  • 实现用于身份验证的 SSO 流。我是这里的新手,无法到达某些地方。我试图实现服务提供商发起的流程。它看起来像这样: < li >用户单击我的前端应用程序上的按钮,通过one 进行身份验证。 < li >用户重定向到联盟表单并选择所需的IdP进行身份验证。 < li >单击IdP按钮后,用户重定向到某些IdP上的特殊授权表单并输入他们的凭据。 < li >用户点击< code >登录并通过< cod