Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Vladimir-Engelgardt opened this issue Oct 13, 2015 · 1 comment

Comments

@Vladimir-Engelgardt
Copy link

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.

@ras0219-msft
Copy link
Contributor

This seems like the right fix. Thanks for the detailed debugging here.

GerHobbelt pushed a commit to GerHobbelt/cpprestsdk that referenced this issue Mar 20, 2024
Invoking the callback could result in _CancellationTokenState being destroyed.
Accessing data members on the destroyed object could cause a crash.
GerHobbelt pushed a commit to GerHobbelt/cpprestsdk that referenced this issue Jun 21, 2024
…microsoft#5)

Co-authored-by: rmyers808 <Richard.Myers@spirentcom.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants