microsoft/cpprestsdk

Inconsistent encoding when comparing oauth1_config::m_token in oauth1_config::token_from_redirected_uri()

開放

#5 建立於 2015年10月13日

 (1 則留言) (0 個反應) (0 位負責人)C++ (1,670 個分叉)batch import
bughelp wanted

倉庫指標

星標
 (7,596 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

Hi,

I am getting an exception at final stage of authentication process - "redirected URI parameter 'oauth_token'='...' does not match temporary token='...'.".

Probably I found why it fails.

  1. When temporary token is received it is stored to oauth1_config::m_token as URI DECODED. See https://github.com/Microsoft/cpprestsdk/blob/master/Release/src/http/oauth/oauth1.cpp:319

  2. After redirection, we get access token by calling oauth1_config::token_from_redirected_uri(uri). Which throws an exception, because it tries to compare token stored at step 1) and URI ENCODED token from redirected uri.

The possible workflow: decode redirected uri manually for oauth1_config::token_from_redirected_uri. Is that correct solution?

Regards, Vladimir.

貢獻者指南