0

我处于危急情况,因为我们必须将 Google Apps 支持集成到我们的应用程序中,该应用程序位于 .Net 2.0 框架中。所以为此我使用 DotNetOpenId v2.5.7。早些时候,为了实现这一点,我们使用 DotNetOpenAuth v3.4.6 在框架 4.0 中创建了一个单独的应用程序,该应用程序将使用 Google Apps 进行身份验证并将数据重定向回所有信息。但该过程存在安全漏洞。所以现在我们必须使用 DotNetOpenId,因为我们的应用程序无法迁移到更高的框架。

主要问题是与 Google Apps 一起使用时。它适用于其 OpenId 端点为https://www.google.com/accounts/o8/ud的 Gmail 帐户。但是,当 OpenId Endpoint 类似于https://www.google.com/a/example.com/o8/ud?be=o8时,它会给我一个断言错误。应用程序将用户正确重定向到 Google Apps 登录页面。但是当它返回数据时,身份验证状态为失败,以下是其中的异常:

Message: The OpenId Provider issued an assertion for an Identifier whose discovery information did not match.

Assertion endpoint info: 
ClaimedIdentifier: http://example.com/openid?id=11......010 
ProviderLocalIdentifier: http://example.com/openid?id=11......010 
ProviderEndpoint: https://www.google.com/a/example.com/o8/ud?be=o8 
OpenID version: 2.0 
Service Type URIs: (unavailable) 

Discovered endpoint info: 
{ClaimedIdentifier: http://specs.openid.net/auth/2.0/identifier_select 
ProviderLocalIdentifier: http://specs.openid.net/auth/2.0/identifier_select 
ProviderEndpoint: https://www.google.com/a/example.com/o8/ud?be=o8 
OpenID version: 2.0 
Service Type URIs: http://specs.openid.net/auth/2.0/server, }

我已经放置了一个 XRDS 文件,该文件可以在此位置http://example.com/openid下载,其数据如下

<?xml version="1.0" encoding="UTF-8"?>
<xrds:XRDS xmlns:xrds="xri://$xrds" xmlns="xri://$xrd*($v*2.0)">
    <XRD>
        <Service priority="0">
            <Type>http://specs.openid.net/auth/2.0/server</Type>
            <URI>https://www.google.com/a/example.com/o8/ud?be=o8</URI>
        </Service>
        <Service priority="10">
            <Type>http://specs.openid.net/auth/2.0/signon</Type>
            <URI>https://www.google.com/a/example.com/o8/ud?be=o8</URI>
        </Service>
    </XRD>
</xrds:XRDS>

但这也无济于事。

我还在http://example.com/.well-known/host-meta位置放置了一个文件,其中包含以下内容:

Link: <https://www.google.com/accounts/o8/site-xrds?hd=example.com>; rel="describedby http://reltype.google.com/openid/xrd-op"; type="application/xrds+xml"

请告诉我我还需要做什么。几天以来,我一直在浏览论坛并使用 Google 来解决此问题,但没有任何进展。

4

1 回答 1

0

DotNetOpenId v2.x 以 .NET 2.0 为目标是正确的。它无法通过他们的 Google Apps OpenID 登录用户,因为 Google Apps 不遵循 OpenID 协议,而是遵循 Google 自己的变体。

DotNetOpenAuth v3.x 是可插入的,允许 Google Apps 通过激活对其 OpenID 变体的支持来工作。

我认为最能帮助您的是知道 DotNetOpenAuth不需要.NET 4.0。只需安装 .NET 3.5,它是 .NET 2.0 的低影响就地更新。您的网站应该会继续正常运行,但 DotNetOpenAuth v3.x 可以正常运行。

于 2011-10-11T16:42:18.357 回答