我的处境非常危急,因为我们必须将Google支持集成到我们的应用程序中,这是在.Net 2.0框架中。为此,我使用了DotNetOpenId v2.5.7。为了实现这一点,我们在Framework4.0中使用DotNetOpenAuth v3.4.6创建了一个单独的应用程序,该应用程序将使用Google进行身份验证,并使用所有信息重定向数据。但这个过程有安全回路漏洞。因此,现在我们必须使用DotNetOpenId,因为我们的应用程序不能迁移到更高的框架。
主要问题是当它与谷歌应用程序一起使用时。对于以OpenId端点作为https://www.google.com/accounts/o8/ud的Gmail帐户,它工作得很好。然而,当OpenId端点类似于这个https://www.google.com/a/example.com/o8/ud?be=o8时,它会给我一个断言错误。应用程序将用户正确地重定向到Google登录页面。但是,当它返回数据时,身份验证状态失败,其中的例外情况如下:
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"请告诉我还需要做什么。我已经浏览论坛和使用谷歌从几天来解决这个问题,但没有进展。
发布于 2011-10-11 16:42:18
您是正确的,因为DotNetOpenId v2.x的目标是.NET 2.0。它不能通过Google登录用户,因为Google不遵循OpenID协议,而是谷歌自己的版本。
Googlev3.x是可插拔的,它允许Google通过激活对DotNetOpenAuth变体OpenID的支持来工作。
我认为对您最有帮助的是知道DotNetOpenAuth不需要.NET 4.0。只需安装.NET 3.5,这是.NET 2.0的一个低影响的就地更新.您的网站应该继续正常运行,但是DotNetOpenAuth v3.x将在其上工作。
https://stackoverflow.com/questions/7722843
复制相似问题