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

- Added the possibility to get the email in the Twitter implementation #118

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

Alexia-AT-Digitecnology

Passing queryParameters => ("include_email", "true") to the GetUserInfo function you can obtain the twitter's email account of the user.

…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);
Copy link
Collaborator

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.

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...

Copy link
Collaborator

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.

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.

Copy link
Collaborator

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?

Copy link
Collaborator

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)");
Copy link
Collaborator

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>(),
Copy link
Collaborator

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"),
Copy link
Collaborator

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?

@niemyjski
Copy link
Collaborator

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.

@niemyjski
Copy link
Collaborator

@Alexia-AT-Digitecnology ^^ 👍

@niemyjski
Copy link
Collaborator

Hello,

Can you please resolve any conflicts and look at the comments above so we can get this merged in.

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.

2 participants