【问题标题】:Thinktecture Identity Server HRD for two Client APP and different Return URLThinktecture Identity Server HRD 用于两个客户端 APP 和不同的返回 URL
【发布时间】:2014-04-03 10:26:53
【问题描述】:

我已经关注了这篇文章Using IdSrv2 as IP-STS with membership store,并且可以在我的第一个客户端应用程序上正常工作,returnurl:abc.com/a.aspx 在一个依赖方和资源中。

对于我的场景,我只想创建一个我自己创建的身份提供者。这是因为我不想显示我在 HRD 页面中创建的所有身份提供商,只想显示我的 IDP 和来自社交网络(facebook、google+ 等)的其他身份服务。

但是当我登录到我的第二个客户端应用程序时,它总是返回 abc.com/a.aspx。有什么解决方案可以解决我的问题吗?

【问题讨论】:

    标签: thinktecture-ident-server


    【解决方案1】:

    我已经创建了我相信您正在努力实现的设置。所以我有 Portal1 和 Portal2。两个门户都设置为通过 idsrv2(thinktecture 身份服务器)对用户进行身份验证,并设置为使用 HRD。 idsrv2 设置为通过 HRD 将用户身份验证委托给 idsrv(thinktecture 身份服务器)。

    Portal1 web.config的配置(仅重要部分)是

    <system.identityModel>
            <identityConfiguration>
              <audienceUris>
                <add value="https://localhost/Portal1/" />
              </audienceUris>
              <issuerNameRegistry type="System.IdentityModel.Tokens.ValidatingIssuerNameRegistry, System.IdentityModel.Tokens.ValidatingIssuerNameRegistry">
                <authority name="http://idsrv2">
                  <keys>
                    <add thumbprint="BCD339ECD62BC50DEDA3B54D2236D12AE1217687" />
                  </keys>
                  <validIssuers>
                    <add name="http://idsrv2" />
                  </validIssuers>
                </authority>
              </issuerNameRegistry>
              <!--certificationValidationMode set to "None" by the the Identity and Access Tool for Visual Studio. For development purposes.-->
              <certificateValidation certificateValidationMode="None" />
            </identityConfiguration>
        </system.identityModel>
        <system.identityModel.services>
            <federationConfiguration>
              <cookieHandler requireSsl="false" />
              <wsFederation passiveRedirectEnabled="true" issuer="https://localhost/idsrv2/issue/hrd" realm="https://localhost/Portal1/" requireHttps="false" />
            </federationConfiguration>
        </system.identityModel.services>
    

    Portal2 的配置(也只是重要部分)是:

    <system.identityModel>
        <identityConfiguration>
            <audienceUris>
                <add value="https://localhost/Portal2/" />
            </audienceUris>
            <issuerNameRegistry type="System.IdentityModel.Tokens.ValidatingIssuerNameRegistry, System.IdentityModel.Tokens.ValidatingIssuerNameRegistry">
                <authority name="http://idsrv2">
                    <keys>
                        <add thumbprint="BCD339ECD62BC50DEDA3B54D2236D12AE1217687" />
                    </keys>
                    <validIssuers>
                        <add name="http://idsrv2" />
                    </validIssuers>
                </authority>
            </issuerNameRegistry>
            <!--certificationValidationMode set to "None" by the the Identity and Access Tool for Visual Studio. For development purposes.-->
            <certificateValidation certificateValidationMode="None" />
        </identityConfiguration>
    </system.identityModel>
    <system.identityModel.services>
        <federationConfiguration>
            <cookieHandler requireSsl="false" />
            <wsFederation passiveRedirectEnabled="true" issuer="https://localhost/idsrv2/issue/hrd" realm="https://localhost/Portal2/" requireHttps="false" />
        </federationConfiguration>
    </system.identityModel.services>
    

    现在,idsrv 的配置(我认为很重要的部分):

    最后是idsrv2的配置:

    在 Portal1 上进行身份验证时最后的网络流量

    【讨论】:

    • 我想显示用于用户登录的 HRD 页面,但现在我有两个客户端应用程序 A (abc.cloudapp.net/oauthclient2/) 和 B (XYZ.cloudapp.net/oauthclient3/) ,A 和 B 将在我创建的 HRD 页面上提供相同的 wsfed 身份提供者(IDP)名称“TMIDP”登录按钮,但在“依赖方和资源”设置中,我还创建了一个 RP 名称“TMIDP”。 RP“TMRP”我必须将“A”url设置为重定向URL。我想让IDP“TMIDP”可以服务于另一个客户端应用程序B并可以重定向到B。但它总是重定向到A。如何我让TMIDP可以重定向到A和B?
    • 将应用程序 B 设置为中继方,方法与将应用程序 A 设置为中继方相同。为应用程序 B 选择一个不同的领域并将重定向 url 设置为应用程序 B。现在访问任何应用程序 A 或 B 的用户都必须进行身份验证。如果您想在应用程序 B 中接受颁发给应用程序 A 的令牌,则在两个应用程序的受众 uri 中设置两个领域。
    • 我将设置保留为HRD‌。然后我按照你提到的为 B 应用程序创建一个 RP 并设置这个 B RP 的不同领域。但我很困惑,如何在 A 和 B 中配置 web.config。当我登录到 B 时,B 仍然被重定向到 A。
    • 您是否将 RP_B 中的重定向 url 设置为应用程序 B?你提到你只设置了不同的领域。
    • 是的,我做到了。我将重定向 url 设置为应用程序 B,但当我登录到 B 时,我仍然重定向到应用程序 A。
    猜你喜欢
    • 2014-03-28
    • 2017-09-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-05-29
    • 2021-01-22
    • 1970-01-01
    • 2013-12-13
    相关资源
    最近更新 更多