DotNetOpenAuth:OpenID Provider返回略微不同的声明标识符

时间:2012-12-05 01:13:08

标签: openid dotnetopenauth

我正处于重新编写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

1 个答案:

答案 0 :(得分:1)

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