Skip to content
This repository has been archived by the owner on Jul 18, 2018. It is now read-only.

Solve a signature error in csharp sample #43

Merged
merged 1 commit into from
Dec 16, 2014
Merged

Solve a signature error in csharp sample #43

merged 1 commit into from
Dec 16, 2014

Conversation

rggammon
Copy link
Contributor

I'm getting an oauth signature error with requests generated by the c# sample. SimpleOAuth.Utilities.UrlHelper.Encode seems to be leading to double url encoding, and one possible fix that works for me is to remove it. Eg - $query.ToString() returns location=San+Francisco%2c+CA (so, already url encoded) in the below.

PS C:> add-type -assemblyname system.web
PS C:> $query = [Web.HttpUtility]::ParseQueryString("")
PS C:> $query["location"] = "San Francisco, CA"
PS C:> $query.ToString()
location=San+Francisco%2c+CA
PS C:> $uriBuilder = new-object UriBuilder("http://foo")
PS C:> $uriBuilder.Query = $query.ToString()
PS C:> $uriBuilder.ToString()
http://foo:80/?location=San+Francisco%2c+CA

…Helper.Encode, which is causing double escaping
@mittonk
Copy link
Contributor

mittonk commented Oct 27, 2014

Hm, adding or removing quoting often has fallout; we'll want to do this carefully.

@rggammon
Copy link
Contributor Author

If this sample is working for others, let me know too :) In particular, when it works, what is the query string from uriBuilder.ToString()

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants