2010-04-30 88 views

回答

2

我使用DotNetOpenAuth,這是我失蹤了......

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

通過將HostMetaDiscoveryService第一和允許UseGoogleHostedHostMeta如預期的要求將工作。

結束了這樣的事情:

var relyingParty = new OpenIdRelyingParty(); 
relyingParty.DiscoveryServices.Insert(0, new DotNetOpenAuth.OpenId.HostMetaDiscoveryService { UseGoogleHostedHostMeta = true, }); 
var response = relyingParty.GetResponse(); 
if (response == null) 
{ 
    var googleID = "https://www.google.com/accounts/o8/site-xrds?hd=my.domain"; 
    var request = relyingParty.CreateRequest(googleID); 
    request.RedirectToProvider(); 
} 
else 
{ 
    switch (response.Status) 
    { 
     case AuthenticationStatus.Authenticated: 
      break; 

     default: 
      break; 
    } 
}