我将 Dotnetopenid 用于我的 openid 解决方案,使用内置用户控件时一切都很好,但是当我想以编程方式实现它时,如下面的代码,
openid.Response.GetExtension<DotNetOpenId.Extensions.SimpleRegistration.ClaimsResponse>();
始终为空。任何的想法?
OpenIdRelyingParty openid = createRelyingParty();
if (openid.Response != null) {
switch (openid.Response.Status) {
case AuthenticationStatus.Authenticated:
// This is where you would look for any OpenID extension responses included
// in the authentication assertion.
// var extension = openid.Response.GetExtension<SomeExtensionResponseType>();
// Use FormsAuthentication to tell ASP.NET that the user is now logged in,
// with the OpenID Claimed Identifier as their username.
State.ProfileFields = openid.Response.GetExtension<DotNetOpenId.Extensions.SimpleRegistration.ClaimsResponse>();
FormsAuthentication.RedirectFromLoginPage(openid.Response.ClaimedIdentifier, false);
break;