0

我正处于修改 DotNetOpenAuth 附带的 OpenID 提供程序 MVC 示例的最后阶段。

我在依赖方收到以下错误“ OpenID 提供程序为发现信息不匹配的标识符发出了断言”。

RP 以以下格式获取声明的标识符:

http://www.sampleOpenIDProvider.com/user/justpartofthecrowd

但它是从 OP 回来的:

http://www.sampleOpenIDProvider.com/SGAccount/Login?ReturnUrl=%2fuser%2fjustpartofthecrowd

对于使用过 DotNetOpenAuth OpenID 提供程序 MVC 示例的任何人,主要区别在于我使用的是 MVC 4 和 Razor 视图...

以防万一这对任何人都有帮助,这里是最后一点的日志:

HTTP GET http://www.sampleOpenIDProvider.com/user/justpartofthecrowd
http://www.sampleOpenIDProvider.com/user/justpartofthecrowd
HTTP GET http://www.sampleOpenIDProvider.com/SGAccount/Login?ReturnUrl=%2fuser%2fjustpartofthecrowd
http://www.sampleOpenIDProvider.com/SGAccount/Login?ReturnUrl=%2fuser%2fjustpartofthecrowd
ENTER controller SGAccount, action Login
EXIT  controller SGAccount, action Login - time spent 1
X-XRDS-Location found in HTML Http-Equiv tag.  Preparing to pull XRDS from http://www.sampleOpenIDProvider.com/Home/xrds
HTTP GET http://www.sampleOpenIDProvider.com/Home/xrds
http://www.sampleOpenIDProvider.com/Home/xrds
HTTP GET http://www.sampleOpenIDProvider.com/SGAccount/Login?ReturnUrl=%2fHome%2fxrds
http://www.sampleOpenIDProvider.com/SGAccount/Login?ReturnUrl=%2fHome%2fxrds
ENTER controller SGAccount, action Login
EXIT  controller SGAccount, action Login - time spent 1
Total services discovered in XRDS: 0
[]
Total services discovered in HTML: 2
[{   ClaimedIdentifier: http://www.sampleOpenIDProvider.com/SGAccount/Login?ReturnUrl=%2fuser%2fjustpartofthecrowd   ProviderLocalIdentifier: http://www.sampleOpenIDProvider.com/SGAccount/Login?ReturnUrl=%2fuser%2fjustpartofthecrowd   ProviderEndpoint: http://www.sampleOpenIDProvider.com/OpenId/Provider   OpenID version: 2.0   Service Type URIs:    http://specs.openid.net/auth/2.0/signon  }, {   ClaimedIdentifier: http://www.sampleOpenIDProvider.com/SGAccount/Login?ReturnUrl=%2fuser%2fjustpartofthecrowd   ProviderLocalIdentifier: http://www.sampleOpenIDProvider.com/SGAccount/Login?ReturnUrl=%2fuser%2fjustpartofthecrowd   ProviderEndpoint: http://www.sampleOpenIDProvider.com/OpenId/Provider   OpenID version: 1.1   Service Type URIs:    http://openid.net/signon/1.1  },]
Protocol error: The OpenID Provider issued an assertion for an Identifier whose discovery information did not match.    Assertion endpoint info:   ClaimedIdentifier: http://www.sampleOpenIDProvider.com/user/justpartofthecrowd  ProviderLocalIdentifier: http://www.sampleOpenIDProvider.com/user/justpartofthecrowd  ProviderEndpoint: http://www.sampleOpenIDProvider.com/OpenId/Provider  OpenID version: 2.0  Service Type URIs:  Discovered endpoint info:  [{   ClaimedIdentifier: http://www.sampleOpenIDProvider.com/SGAccount/Login?ReturnUrl=%2fuser%2fjustpartofthecrowd   ProviderLocalIdentifier: http://www.sampleOpenIDProvider.com/SGAccount/Login?ReturnUrl=%2fuser%2fjustpartofthecrowd   ProviderEndpoint: http://www.sampleOpenIDProvider.com/OpenId/Provider   OpenID version: 2.0   Service Type URIs:    http://specs.openid.net/auth/2.0/signon  }, {   ClaimedIdentifier: http://www.sampleOpenIDProvider.com/SGAccount/Login?ReturnUrl=%2fuser%2fjustpartofthecrowd   ProviderLocalIdentifier: http://www.sampleOpenIDProvider.com/SGAccount/Login?ReturnUrl=%2fuser%2fjustpartofthecrowd   ProviderEndpoint: http://www.sampleOpenIDProvider.com/OpenId/Provider   OpenID version: 1.1   Service Type URIs:    http://openid.net/signon/1.1  },]     at DotNetOpenAuth.Messaging.ErrorUtilities.VerifyProtocol(Boolean condition, String unformattedMessage, Object[] args)     at DotNetOpenAuth.OpenId.RelyingParty.PositiveAuthenticationResponse.VerifyDiscoveryMatchesAssertion(OpenIdRelyingParty relyingParty)     at DotNetOpenAuth.OpenId.RelyingParty.PositiveAuthenticationResponse..ctor(PositiveAssertionResponse response, OpenIdRelyingParty relyingParty)     at DotNetOpenAuth.OpenId.RelyingParty.OpenIdRelyingParty.GetResponse(HttpRequestBase httpRequestInfo)     at OpenIdRelyingPartyMvc.Controllers.UserController.Authenticate(String returnUrl)     at lambda_method(Closure , ControllerBase , Object[] )     at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters)     at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters)     at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass15.<InvokeActionMethodWithFilters>b__12()     at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation)     at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor, IDictionary`2 parameters)     at System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName)     at System.Web.Mvc.Controller.ExecuteCore()     at System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext)     at System.Web.Mvc.MvcHandler.<>c__DisplayClass6.<>c__DisplayClassb.<BeginProcessRequest>b__5()     at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass1.<MakeVoidDelegate>b__0()     at System.Web.Mvc.MvcHandler.<>c__DisplayClasse.<EndProcessRequest>b__d()     at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()     at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)     at System.Web.HttpApplication.PipelineStepManager.ResumeSteps(Exception error)     at System.Web.HttpApplication.BeginProcessRequestNotification(HttpContext context, AsyncCallback cb)     at System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context)     at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)     at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)     at System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(IntPtr pHandler, RequestNotificationStatus& notificationStatus)     at System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(I
4

1 回答 1

1

在我看来,您的http://www.sampleOpenIDProvider.com/user/justpartofthecrowdURL 正在重定向到登录页面(未通过身份验证时)。你不能这样配置它。声明的标识符 URL 必须可供匿名客户端公开访问。

于 2012-12-06T17:16:32.087 回答