DotNetOpenAuth + MVC2 + Google App Standard

时间:2010-08-05 15:22:50

标签: asp.net-mvc dotnetopenauth google-apps

我正在尝试对我的ASP.Net MVC2应用程序的用户进行身份验证,然后抛出谷歌应用程序标准版帐户。我无法找到实现的例子和文档。我查看了DotNetOpenAuth Samples Solution,但没有根据我的需求找到一个例子。所有的例子都是针对Google帐户的,但没有谷歌应用程序。

我有点困惑。例如:

  1. 我是否必须在我的网站上放置xrds文档,或者我可以依赖Google帐户(例如“https://www.google.com/accounts/o8/.well-known/host-meta?hd=example.com”?)
  2. 证书怎么样?我必须将它放在我的网站上吗?

2 个答案:

答案 0 :(得分:0)

你看过OpenIdRelyingPartyWebForms / loginGoogleApps.aspx样本吗?

答案 1 :(得分:0)

安德鲁的示例非常有效,它正在使用发现服务向UseGoogleHostedHostMeta = true类提供OpenIdRelyingParty

HostMetaDiscoveryService GoogleAppsDiscovery = new HostMetaDiscoveryService { UseGoogleHostedHostMeta = true };
...
relyingParty = new OpenIdRelyingParty();
relyingParty.DiscoveryServices.Insert(0, GoogleAppsDiscovery);

我在MVC中没有找到类似的行为。