2

我正在研究 DotNetOpenAuth 示例,并实现一个 openID 提供程序和依赖方。

本质上,它与提供的 DotNetOpenAuth 示例非常相似,只是我使用的是 MVC 4,因此使用的是 Razor,因此没有使用示例中使用的IdentityEndpoint控件。(我改为在部分视图中写出提供程序标头)。也托管在 IIS 7.5 中。

我到了用户登录的地步,并且 OP 正在从日志中重定向回依赖方,该依赖方出现以下错误:


DotNetOpenAuth.Messaging.ProtocolException: DotNetOpenAuth.Messaging.ErrorUtilities.VerifyProtocol(Boolean condition, String unformattedMessage, Object[] args)
在 DotNetOpenAuth.Messaging 中缺少存储桶“https://localhost/dnoa/association_handles”句柄“3tg1”的解密密钥.DataBagFormatterBase`1.CalculateSignature(Byte[] bytesToSign, String symmetricSecretHandle)
a....

我不确定它是否有帮助,但错误之前的两个标题是:

Signing these message parts:    
claimed_id: http://www.sampleOpenIDProvider.com/user/justpartofthecrowd   
identity: http://www.sampleOpenIDProvider.com/user/justpartofthecrowd   
assoc_handle: he9m!IAAAAD43Voo3-zQng-ZVSKb9ryFVSIKDLJj4Ph_I9W64ypFCQQAAAAFlZWUQzOJQfO70Pvud2a--auCE7HKkFjBM45HXlpJixLEmtdgd8YPBMckvUFnIPqHBbaAk7mkhI8lDVPoKekUW   
op_endpoint: http://www.sampleOpenIDProvider.com/OpenId/Provider   
return_to: http://www.samplemobilephonecompany.com/User/Authenticate?ReturnUrl=Index&dnoa.userSuppliedIdentifier=http%3A%2F%2Fwww.sampleOpenIDProvider.com   
response_nonce: 2012-12-03T23:59:05ZCqMBPIFL    
Base64 representation of signed data: Y2xhaW1lZF9pZDpodHRwOi8vd3d3LnNvbGZ5cmUtaWQuY29tL3VzZXIvcmFscGhza2kKaWRlbnRpdHk6aHR0cDovL3d3dy5zb2xmeXJlLWlkLmNvbS91c2VyL3JhbHBoc2tpCmFzc29jX2hhbmRsZTpoZTltIUlBQUFBRDQzVm9vMy16UW5nLVpWU0tiOXJ5RlZTSUtETEpqNFBoX0k5VzY0eXBGQ1FRQUFBQUZsWldVUXpPSlFmTzcwUHZ1ZDJhLS1hdUNFN0hLa0ZqQk00NUhYbHBKaXhMRW10ZGdkOFlQQk1ja3ZVRm5JUHFIQmJhQWs3bWtoSThsRFZQb0tla1VXCm9wX2VuZHBvaW50Omh0dHA6Ly93d3cuc29sZnlyZS1pZC5jb20vT3BlbklkL1Byb3ZpZGVyCnJldHVybl90bzpodHRwOi8vd3d3LnNhbXBsZW1vYmlsZXBob25lY29tcGFueS5jb20vVXNlci9BdXRoZW50aWNhdGU/UmV0dXJuVXJsPUluZGV4JmRub2EudXNlclN1cHBsaWVkSWRlbnRpZmllcj1odHRwJTNBJTJGJTJGd3d3LnNvbGZ5cmUtaWQuY29tCnJlc3BvbnNlX25vbmNlOjIwMTItMTItMDNUMjM6NTk6MDVaQ3FNQlBJRkwK  
Signature: kw4f92CpwFbXgUkLs+Pf+5cFrtEzmE9KpxHgTYwi1tQ=

After binding element processing, the received IndirectSignedResponse (2.0) message is:    
openid.sig: kw4f92CpwFbXgUkLs+Pf+5cFrtEzmE9KpxHgTYwi1tQ=   
openid.signed: claimed_id,identity,assoc_handle,op_endpoint,return_to,response_nonce   
openid.assoc_handle: he9m!IAAAAD43Voo3-zQng-ZVSKb9ryFVSIKDLJj4Ph_I9W64ypFCQQAAAAFlZWUQzOJQfO70Pvud2a--auCE7HKkFjBM45HXlpJixLEmtdgd8YPBMckvUFnIPqHBbaAk7mkhI8lDVPoKekUW   
openid.invalidate_handle: 3tg1!IAAAALLyXKaShsmSDmEaKWxiBCi7-a8Nso0tyNaPKVqi52KuQQAAAAHvnjGT2Gt-_iWlSTpmBgthNS8s2Dxs6-pQG6rzYrFqgA5mp_T_HPcaJ6BchUsN9Lx2uH7jssuSAq0xbae7lb1r   
openid.op_endpoint: http://www.sampleOpenIDProvider.com/OpenId/Provider   
openid.return_to: http://www.samplemobilephonecompany.com/User/Authenticate?ReturnUrl=Index&dnoa.userSuppliedIdentifier=http%3A%2F%2Fwww.sampleOpenIDProvider.com   
openid.response_nonce: 2012-12-03T23:59:05ZCqMBPIFL   
openid.mode: id_res   
openid.ns: http://specs.openid.net/auth/2.0   
openid.claimed_id: http://www.sampleOpenIDProvider.com/user/justpartofthecrowd   
openid.identity: http://www.sampleOpenIDProvider.com/user/justpartofthecrowd   
ReturnUrl: Index   dnoa.userSuppliedIdentifier: http://www.sampleOpenIDProvider.com  

我想这对那些已经实施 dotnetopenauth 的人来说只意味着什么,但值得一试!

4

1 回答 1

2

在通过谷歌群组搜索时意外修复了它,并阅读了另一个问题,其中曾经有帮助的 Andrew Arnott 建议检查所有 openID 端点是否可以在未经授权的情况下访问。

所以我检查了我的代码,我的 RegisterGlobalFilters 中有以下语句:

filters.Add(new System.Web.Mvc.AuthorizeAttribute());

我在用于 openID 的所有控制器或操作上将其与[AllowAnonymous]属性一起使用。或者我认为,因为删除全局过滤器,然后仅将[Authorize]属性显式添加到需要授权的区域解决了问题。

于 2012-12-04T13:30:25.990 回答