-
Notifications
You must be signed in to change notification settings - Fork 154
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
- Added the possibility to get the email in the Twitter implementation #118
base: master
Are you sure you want to change the base?
Conversation
…n passing queryParameters => ("include_email", "true") to the GetUserInfo function.
@@ -44,7 +44,7 @@ public interface IClient | |||
/// Callback request payload (parameters). | |||
/// <example>Request.QueryString</example> | |||
/// </param> | |||
UserInfo GetUserInfo(NameValueCollection parameters); | |||
UserInfo GetUserInfo(NameValueCollection parameters, NameValueCollection queryParameters = null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we use parameters
for this? I'm not sure we need to introduce a new field as all the other implementations are passing state when needed already.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think is the only form to pass parameters to the QueryUserInfo() method...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please confirm this as configuration is passed through to each oauth implementation. I know extra state parameters can be set on the initial request.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's only for OAuth1 clients, Twitter specific, but maybe another OAuth1 client needs this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@titarenko do you have any more info on this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you covert this to be a IDictionary<string,string>. It would be nice to not use any super specialized collections.
@@ -71,7 +71,7 @@ protected override Endpoint UserInfoServiceEndpoint | |||
/// </summary> | |||
protected override void BeforeGetUserInfo(BeforeAfterRequestArgs args) | |||
{ | |||
args.Request.AddParameter("fields", "id,first_name,last_name,email,picture"); | |||
args.Request.AddParameter("fields", "id,first_name,last_name,email,picture.width(256).height(256)"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any reason the width and height is specified here. It seems we want three different image sizes. If this is due to an api change can you please attach a link to the info.
@@ -109,14 +110,14 @@ protected override UserInfo ParseUserInfo(string content) | |||
return new UserInfo | |||
{ | |||
Id = response["id"].Value<string>(), | |||
Email = null, | |||
Email = response["email"] == null ? null : response["email"].Value<string>(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be better to call SafeGet to get the string value here so we don't blow up.
FirstName = firstName, | ||
LastName = lastName, | ||
AvatarUri = | ||
{ | ||
Small = avatarUri.Replace("normal", "mini"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this due to an api change? If so can you please attach a link to the info?
Hello sorry for the delay. I reviewed again and I think the changes are good. There is some merge conflicts due to us moving fully to async. Can you please take a look at my comments and update the usages and be sure the tests pass. |
Hello, Can you please resolve any conflicts and look at the comments above so we can get this merged in. |
Passing queryParameters => ("include_email", "true") to the GetUserInfo function you can obtain the twitter's email account of the user.