AlexGhiondea/OAuth.net

Allow text qualifier for OAuth parameter values

jtcalhoun opened this issue · 5 comments

I'm trying to connect to a service provider that requires each OAuth parameter value to be qualified with double-quotes. (e.g. oauth_timestamp="1527612231" vs. oauth_timestamp=1527612231)

Any thoughts on adding a way to (optionally?) include a text-qualifier for header values?

Relevant code:

sb.AppendFormat("{0}={1},", param.Key, System.Net.WebUtility.HtmlEncode(param.Value));

Actually, if I'm reading the OAuth specification correctly there should always be double quotes for the parameters in the header. See section 3.5.1 point 2. Therefore all service providers should be able to handle the quotes (and apparently some handle it without quotes as well), so there should be no need to make it optional. What do you think @AlexGhiondea?

I agree — this looks like a bug — we should encode the parameters with double quotes. I am not sure if we should have an option to toggle this or not. As @SimonTouchtech points out the protocol requires the quotes to be there.

Let’s go without option to tweak this for now.

Closed by accident - reopened.

I can put a PR up this weekend and can push an updated package once the PR is merged. I suspect this is a small change to the line mentioned — although the tests might need to be patched.

The package has been published!

Great! Thanks!