Skip to content

Conversation

@jasond-s
Copy link

I love the simplicity of this library, but I have been working with some APIs that implement OAuth1 in a non standard way and require either capturing extra information from the response, or passing extra information in the requests.

Initially it would be really good if I could get these params out of the responses.

Happy to iterate over this suggestion till it suits everyone.

Copy link

@VictorioBerra VictorioBerra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like there a few formatting issues where there are missing tabs or something.

{
public string AccessToken { get; set; }
public string AccessTokenSecret { get; set; }
public IDictionary<string, string> AdditionalParams { get; set; }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formatting.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I don't see it in my editor. Which is odd, because it isn't a tabs/spaces thing I don't think. Will fix.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah. It is. You use tabs.

{
public string RequestToken { get; set; }
public string RequestTokenSecret { get; set; }
public IDictionary<string, string> AdditionalParams { get; set; }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formatting.

break;
}
}
var oauthToken = keyValPairs["oauth_token"];

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this throw if the key does not exist? The old behavior would simply keep keyValPairs and oauthToken null. Maybe we do not want this new behavior?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair. It would throw I believe. I did this very quickly last night. Wasn't expecting you to get your eyes on it so quickly 😝

}
var keyValPairs = HttpUtility.ParseQueryString(responseText);

var oauthToken = keyValPairs["oauth_token"];

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above comment.

RequestToken = oauthToken,
RequestTokenSecret = oauthTokenSecret
RequestTokenSecret = oauthTokenSecret,
AdditionalParams = ToDictionary(keyValPairs)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formatting.

}

private static string ConcatList(IEnumerable<string> source, string separator)
private static IDictionary<string, string> ToDictionary(NameValueCollection col)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this be better as an extension method in its own file?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure.

@johot
Copy link
Owner

johot commented Mar 21, 2019

Hi guys! I am no longer using this project myself, are some of you willing to maintain it? I can add you if you want to? @VictorioBerra

review comments and do not throw if oauth values are not present in response

tabs not spaces
@jasond-s jasond-s force-pushed the feature-additional-params branch from 49215df to dfe8377 Compare March 21, 2019 09:49
@jasond-s
Copy link
Author

Apologies for the messy nature of the PR. Have squashed all the changes into one commit that is a bit more reviewable!

@VictorioBerra
Copy link

@johot You can add me, I am fine with reviewing and accepting PRs and issue replies but I don't think I have time to do any heavy lifting such as bug fixing, or feature additions.

@jasond-s
Copy link
Author

@johot and @VictorioBerra I am happy to contribute some time as well. Maybe between us there will be enough resource to get things done? This and possibly some companion version for OAuth2 are in my own interest currently.

@VictorioBerra
Copy link

I think there are a large amount of good Oauth2 libs out at the moment

@jasond-s
Copy link
Author

That's true, I'm not suggesting turning TinyOAuth1 into ComplexOAuthX, just highlighting that OAuth is a point of focus for me professionally, so have head space to help out in a project like this 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants