我现在可以正确登录并获得密码,所以我仍然将其视为进步。
有人可以检查我正在加密的字符串吗?
“错误请求”还有什么含义?
首先,我得到了
生成这个签名库 的 AccessToken
'GET&https%3A%2F%2Fetws.etrade.com%2Foauth%2Frequest_token&oauth_callback%3Doob%26oauth_consumer_key%3Dc5164d11e1a0a23901d75e7aa1993085%26oauth_nonce%3D565e334127934d65aa4375d0cd2770a1%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1502146468%26oauth_version%3D1.0'
然后它调用执行此行的 SignContext
signingContext.SignatureBase = authContext.GenerateSignatureBase();
生成此签名库
'GET&https%3A%2F%2Fetws.etrade.com%2Foauth%2Frequest_token&oauth_callback%3Doob%26oauth_consumer_key%3Dc5164d11e1a0a23901d75e7aa1993085%26oauth_nonce%3D565e334127934d65aa4375d0cd2770a1%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1502146468%26oauth_version%3D1.0'
然后它得到引脚。
然后它调用生成此签名库的 ExchangeRequestTokenForAccessToken
'GET&https%3A%2F%2Fetws.etrade.com%2Foauth%2Faccess_token&oauth_consumer_key%3Dc5164d11e1a0a23901d75e7aa1993085%26oauth_nonce%3De63bba497c24492ab0d60366526c781a%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1502146597%26oauth_token%3D6WHEWvcaVYx59bRxzic%252FXJGGYrz4TGdH5uvlfNCdkOY%253D%26oauth_verifier%3DNHD85%26oauth_version%3D1.0 '
然后它使用这个签名库再次对上下文进行签名
'GET&https%3A%2F%2Fetws.etrade.com%2Foauth%2Faccess_token&oauth_consumer_key%3Dc5164d11e1a0a23901d75e7aa1993085%26oauth_nonce%3De63bba497c24492ab0d60366526c781a%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1502146597%26oauth_token%3D6WHEWvcaVYx59bRxzic%252FXJGGYrz4TGdH5uvlfNCdkOY%253D%26oauth_verifier%3DNHD85%26oauth_version%3D1.0 '
然后我尝试使用此签名库 获取 A 的报价
'GET&https%3A%2F%2Fetws.etrade.com%2Fmarket%2Frest%2Fquote%2FA&detailFlag%3DALL%26oauth_consumer_key%3Dc5164d11e1a0a23901d75e7aa1993085%26oauth_nonce%3D4a3640c5fc5c40b490c475a2e6c0228e%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1502146666%26oauth_token%3D77vmxV1reXdgDJewWspVKmOduwdDsZGVvLfZBUtBSms%253D%26oauth_version%3D1 .0'
检索报价失败并返回:
8/7/2017 5:57:46 PM - Header Start 8/7/2017 5:58:18 PM - Authorization: OAuth
oauth_token='77xmvV1reXdgDJewWspVKmOduwdDsZGVvLfZUBtBSms%3D',oauth_nonce='4a3640c5fc5c40b490c475a2e6c0228e',oauth_consumer_key='c5164d11e1a0a23901d75e7aa1993085',oauth_signature_method ='HMAC-SHA1',oauth_timestamp='1502146666',oauth_version='1.0',oauth_signature='2OihTU%2BphJjPuvp82lR8Z2QhE24%3D' 2017 年 8 月 7 日下午 5:58:18 - 标题结束 2017 年 8 月 7 日 5:58 :18 PM - System.Net.WebException:远程服务器返回错误:(400)错误请求。在 System.Net.HttpWebRequest.GetResponse()
at EquityMetrics.Retrieve.ETradeModel.GetResponse(OAuthSession session, String url) in C:{path}\Model\ETradeModel.cs:line 94
8/7/2017 5:58:18 PM - 编译指示:
nnCoection:关闭传输编码:分块缓存控制:无缓存,无存储内容类型:应用程序/xml 日期:星期一,2017 年 8 月 7 日 22:58:18 GMT 服务器:Apache