titarenko / OAuth2

OAuth2 client implementation for .NET
412 stars 154 forks source link

Yahoo email retriever social API #125

Open segurofacildeveloper opened 6 years ago

segurofacildeveloper commented 6 years ago

Yahoo not show email permission to all new users and projects... so, social API put email on other scope...

I used this code to retrieve principal email from yahoo's response. Maybe this help your API, or not, i posted to try to help.

YahooClient.cs

userInfo.Email = response.SelectToken("emails")?.ToString(); if (string.IsNullOrEmpty(userInfo.Email)) { try { userInfo.Email = response.SelectTokens("profile.emails").Values().Where(o => o["primary"].ToString().Equals("True")).FirstOrDefault()["handle"].ToString(); } catch { } }