简体   繁体   中英

DotNetOpenAuth OpenID Provider “Sequence contains more than one element”

I'm having trouble implementing my OpenID provider with DNOA 3.4.3. Everything was going absolutely peachy until I needed AX support as well. I set AXFetchAsSregTransform in the web config, as recommended by Andrew at http://groups.google.com/group/dotnetopenid/browse_thread/thread/5629a24c0a7e8d99 . Doing this caused me to get the exception "Sequence Contains More Than One Element" on my decide.aspx page, however, and I haven't been able to get past it.

The following line is throwing the exception:
Edit: Strangely enough, this is not the line throwing the error anymore. The SendResponse() is now triggering the exception

ClaimsRequest requestedFields = ProviderEndpoint.PendingRequest.GetExtension();

ProviderEndpoint.SendResponse()

Any thoughts on why this may be? Any help would be greatly appreciated!

The logs leading up to the error are as follows:

\n2010-04-28 12:38:20,247 (GMT-7) [5] INFO DotNetOpenAuth.Messaging.Channel - Scanning incoming request for messages: https://myprovider/provider.ashx?openid.ns=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0&openid.claimed_id=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select&openid.identity=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select&openid.mode=checkid_setup&openid.ns.ext1=http%3A%2F%2Fopenid.net%2Fsrv%2Fax%2F1.0&openid.ext1.mode=fetch_request&openid.ext1.type.email=http%3A%2F%2Faxschema.org%2Fcontact%2Femail&openid.ext1.type.fullname=http%3A%2F%2Faxschema.org%2FnamePerson&openid.ext1.type.language=http%3A%2F%2Faxschema.org%2Fpref%2Flanguage&openid.ext1.required=email&openid.return_to=http%3A%2F%2Fmyrelyingparty%2Flogin.jsp%3Foidreturn%3D%252Fhome&openid.assoc_handle=%7B634080802953194640%7D%7BHxjFNw==%7D%7B20%7D&openid.realm=http%3A%2F%2Fmyrelyingparty \n2010-04-28 12:38:20,285 (GMT-7) [5] INFO DotNetOpenAuth.Messaging.Channel - Processing incoming CheckIdRequest (2.0) message: \n    openid.claimed_id: http://specs.openid.net/auth/2.0/identifier_select \n    openid.identity: http://specs.openid.net/auth/2.0/identifier_select \n    openid.assoc_handle: {634080802953194640}{HxjFNw==}{20} \n    openid.return_to: http://myrelyingparty/login.jsp?oidreturn=%2Fhome \n    openid.realm: http://myrelyingparty/ \n    openid.mode: checkid_setup \n    openid.ns: http://specs.openid.net/auth/2.0 \n    openid.ns.ext1: http://openid.net/srv/ax/1.0 \n    openid.ext1.mode: fetch_request \n    openid.ext1.type.email: http://axschema.org/contact/email \n    openid.ext1.type.fullname: http://axschema.org/namePerson \n    openid.ext1.type.language: http://axschema.org/pref/language \n    openid.ext1.required: email \n\n2010-04-28 12:38:22,773 (GMT-7) [14] INFO DotNetOpenAuth.Messaging.Channel - Scanning incoming request for messages: https://myprovider/login.aspx?ReturnUrl=%2fdecide.aspx \n2010-04-28 12:38:36,167 (GMT-7) [5] INFO DotNetOpenAuth.Messaging.Channel - Scanning incoming request for messages: https://myprovider/login.aspx?ReturnUrl=%2fdecide.aspx \n2010-04-28 12:38:38,147 (GMT-7) [14] ERROR DotNetOpenAuth.Messaging - Protocol error: An HTTP request to the realm URL (http://myrelyingparty/) resulted in a redirect, which is not allowed during relying party discovery. \n   at DotNetOpenAuth.Messaging.ErrorUtilities.VerifyProtocol(Boolean condition, String message, Object[] args) \n   at DotNetOpenAuth.OpenId.Realm.Discover(IDirectWebRequestHandler requestHandler, Boolean allowRedirects) \n   at DotNetOpenAuth.OpenId.Realm.DiscoverReturnToEndpoints(IDirectWebRequestHandler requestHandler, Boolean allowRedirects) \n   at DotNetOpenAuth.OpenId.Provider.HostProcessedRequest.IsReturnUrlDiscoverableCore(OpenIdProvider provider) \n   at DotNetOpenAuth.OpenId.Provider.HostProcessedRequest.IsReturnUrlDiscoverable(OpenIdProvider provider) \n   at OpenIdProviderWebForms.decide.Page_Load(Object src, EventArgs e) \n   at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) \n   at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) \n   at System.Web.UI.Control.OnLoad(EventArgs e) \n   at System.Web.UI.Control.LoadRecursive() \n   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) \n   at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) \n   at System.Web.UI.Page.ProcessRequest() \n   at System.Web.UI.Page.ProcessRequest(HttpContext context) \n   at ASP.decide_aspx.ProcessRequest(HttpContext context) \n   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() \n   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) \n   at System.Web.HttpApplication.PipelineStepManager.ResumeSteps(Exception error) \n   at System.Web.HttpApplication.BeginProcessRequestNotification(HttpContext context, AsyncCallback cb) \n   at System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) \n   at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr managedHttpContext, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags) \n   at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr managedHttpContext, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags) \n   at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr managedHttpContext, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags) \n   at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr managedHttpContext, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags) \n\n2010-04-28 12:38:38,149 (GMT-7) [14] INFO DotNetOpenAuth.Yadis - Relying party discovery at URL http://myrelyingparty/ failed.  DotNetOpenAuth.Messaging.ProtocolException: An HTTP request to the realm URL (http://myrelyingparty/) resulted in a redirect, which is not allowed during relying party discovery. \n   at DotNetOpenAuth.Messaging.ErrorUtilities.VerifyProtocol(Boolean condition, String message, Object[] args) in c:\\TeamCity\\buildAgent\\work\\bf9e2ca68b75a334\\src\\DotNetOpenAuth\\Messaging\\ErrorUtilities.cs:line 235 \n   at DotNetOpenAuth.OpenId.Realm.Discover(IDirectWebRequestHandler requestHandler, Boolean allowRedirects) in c:\\TeamCity\\buildAgent\\work\\bf9e2ca68b75a334\\src\\DotNetOpenAuth\\OpenId\\Realm.cs:line 446 \n   at DotNetOpenAuth.OpenId.Realm.DiscoverReturnToEndpoints(IDirectWebRequestHandler requestHandler, Boolean allowRedirects) in c:\\TeamCity\\buildAgent\\work\\bf9e2ca68b75a334\\src\\DotNetOpenAuth\\OpenId\\Realm.cs:line 424 \n   at DotNetOpenAuth.OpenId.Provider.HostProcessedRequest.IsReturnUrlDiscoverableCore(OpenIdProvider provider) in c:\\TeamCity\\buildAgent\\work\\bf9e2ca68b75a334\\src\\DotNetOpenAuth\\OpenId\\Provider\\HostProcessedRequest.cs:line 142 \n2010-04-28 12:38:42,076 (GMT-7) [8] ERROR OpenIdProviderWebForms.Global - An unhandled exception was raised.  Details follow: System.Web.HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown.  ---> System.InvalidOperationException: Sequence contains more than one element \n   at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable`1 source) \n   at DotNetOpenAuth.OpenId.Provider.Request.GetExtension[T]() in c:\\TeamCity\\buildAgent\\work\\bf9e2ca68b75a334\\src\\DotNetOpenAuth\\OpenId\\Provider\\Request.cs:line 176 \n   at DotNetOpenAuth.OpenId.Extensions.ExtensionsInteropHelper.ConvertSregToMatchRequest(IHostProcessedRequest request) in c:\\TeamCity\\buildAgent\\work\\bf9e2ca68b75a334\\src\\DotNetOpenAuth\\OpenId\\Extensions\\ExtensionsInteropHelper.cs:line 180 \n   at DotNetOpenAuth.OpenId.Behaviors.AXFetchAsSregTransform.DotNetOpenAuth.OpenId.Provider.IProviderBehavior.OnOutgoingResponse(IAuthenticationRequest request) in c:\\TeamCity\\buildAgent\\work\\bf9e2ca68b75a334\\src\\DotNetOpenAuth\\OpenId\\Behaviors\\AXFetchAsSregTransform.cs:line 139 \n   at DotNetOpenAuth.OpenId.Provider.OpenIdProvider.ApplyBehaviorsToResponse(IRequest request) in c:\\TeamCity\\buildAgent\\work\\bf9e2ca68b75a334\\src\\DotNetOpenAuth\\OpenId\\Provider\\OpenIdProvider.cs:line 482 \n   at DotNetOpenAuth.OpenId.Provider.OpenIdProvider.SendResponse(IRequest request) in c:\\TeamCity\\buildAgent\\work\\bf9e2ca68b75a334\\src\\DotNetOpenAuth\\OpenId\\Provider\\OpenIdProvider.cs:line 325 \n   at OpenIdProviderWebForms.decide.Yes_Click(Object sender, EventArgs e) in C:\\Projects\\OpenIdProviderWebForms\\decide.aspx.cs:line 130 \n   at System.Web.UI.WebControls.Button.OnClick(EventArgs e) \n   at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) \n   at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) \n   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) \n   --- End of inner exception stack trace --- \n   at System.Web.UI.Page.HandleError(Exception e) \n   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) \n   at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) \n   at System.Web.UI.Page.ProcessRequest() \n   at System.Web.UI.Page.ProcessRequest(HttpContext context) \n   at ASP.decide_aspx.ProcessRequest(HttpContext context) in c:\\Windows\\Microsoft.NET\\Framework64\\v2.0.50727\\Temporary ASP.NET Files\\root\\7f580b93\\b3e4d917\\App_Web_tulh9ymv.1.cs:line 0 \n   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() \n   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) \n

Oops. You found a bug in DotNetOpenAuth.

Fix checked into v3.2 as 7cea654 and v3.4 as bd7c148 . You can get the fix in tomorrow's build .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM