1

I'm building a site where people from an organization will login with their organization-provided Google Apps accounts. The site uses DotNetOpenAuth's standard OpenID sample code to authenticate with the Google OpenID provider.

OpenID is enabled on this Google Apps domain, but when I attempt to authenticate a user via the https://google.com/accounts/o8/site-xrds?hd=domain.com endpoint, I get the following error:

Error occurred while sending a direct message or getting the response.

However, if I use the standard https://www.google.com/accounts/o8/id endpoint and sign in with my Google Apps account, it works!

Why does the same Google Apps account produce two different results: one endpoint works, the other fails to authenticate properly?

4

1 回答 1

1

Google Apps 并不完全遵循 OpenID 2.0 协议。它有一个专有的发现机制,默认情况下 DotNetOpenAuth 没有打开。

在 OpenIdRelyingPartyWebForms 项目的 loginGoogleApps.aspx 文件中查看SourceForge 的示例。您会看到它的代码隐藏将 Google Apps 发现添加到 OpenIdRelyingParty 类。如果你这样做,我认为它也对你有用。

于 2013-02-11T05:20:04.670 回答