[英]How to generate hmac sign in python 3 (icq auth)?
my code: http://pastebin.com/fuFxaxTT 我的代码: http : //pastebin.com/fuFxaxTT
and have link: 并具有链接:
http://api.icq.net/aim/startSession?f=json&language=ru&events=mchat%2CuserAddedToBuddyList%2Chist%2CimState%2Cbuddylist&includePresenceFields=aimId%2Cfriendly%2Cstate%2Cssl&sessionTimeout=2592000&ts=1486941017&k=ic17mFHiwr52TKrx&a=%252FwQAAAAAAAGM2*****OTVCDd%252BSNbxZMzUDE0FKQ3Dc2MCVL8DpHgHX8z8%252BWEK3UI6LmhnP362bl%252FluMpxZB033a6qvxSmIkiCsY%253D&view=online&invisible=false&mobile=0&sig_sha256=gI93nv8lo0n9t3*****6uSH43fKnQzPL8Yo=
but have error: 但有错误:
{"response":{"statusCode":401, "statusText":"Authentication Required. statusDetailCode 1014", "statusDetailCode":1014, "data":{"ts":1486941017}}}
i found example in nodejs - https://gist.github.com/foozzi/1382fce29b87bf2ea5544ca73a54a4d4#file-gistfile1-txt-L205 , but where error in my code? 我发现例子的NodeJS - https://gist.github.com/foozzi/1382fce29b87bf2ea5544ca73a54a4d4#file-gistfile1-txt-L205 ,但如果错误在我的代码?
Maybe it's too late, but I've just successfully implemented session creation on C# and I can share some experience. 也许为时已晚,但是我刚刚在C#上成功实现了会话创建,我可以分享一些经验。 According to ICQ desktop client source code they form URL signature a little different as below-
根据ICQ桌面客户端源代码,它们形成的URL签名略有不同,如下所示:
"POST&" + UrlEncode(url) + "&" + UrlEncode("param1=UrlEncode(value1)¶m2=UrlEncode(value2)&...")
So I guess you missed url-encoding in some places. 所以我想您在某些地方错过了url编码。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.