Comments (10)
+1
from oauth2.
For example, need phone, but this property not presented in UserInfo :)
from oauth2.
We are using your fantastic library , but now we need to get additional user info from LinkedIn; concretely, the country of the user (inside location): https://developer.linkedin.com/docs/fields/basic-profile
Note that location is a structured data item, so maybe key-value pairs is not the best solution.
What do you recommend us? Extending your library somehow? Thanks
from oauth2.
Previously in a different library, we always parsed the data into key value pairs. Currently this functionality isn't available (myself or someone needs to build it) but we should have a dictionary where we can return all the extended data items.
from oauth2.
In this case you could parse it out into location.name = value or you could store it as json?
from oauth2.
Maybe we could add a AllData
member to UserInfo
class... (maybe XDocument or JObject); and then store there all the user data coming from the server
from oauth2.
I would think you would want to store the values in a dictionary and not use something that is transport specific like jobject and xdoc.
from oauth2.
Sure, @ejsmith ... I was just thinking about a quick-and-dirty solution :)
from oauth2.
I got this working in a quick way, without modifying existing API
using System.Collections.Generic;
using System.Linq;
using OAuth2.Configuration;
using OAuth2.Infrastructure;
using OAuth2.Models;
using OAuth2.Client;
namespace OAuth2.Example.Models
{
public class MyGoogleClient : OAuth2.Client.Impl.GoogleClient
{
public MyGoogleClient(IRequestFactory factory, IClientConfiguration configuration)
: base(factory, configuration)
{
}
protected override UserInfo ParseUserInfo(string content)
{
return base.ParseUserInfo(content);
}
}
public class MyAuthorizationRoot : AuthorizationRoot
{
private readonly IRequestFactory _requestFactory;
private readonly OAuth2ConfigurationSection _configurationSection;
public MyAuthorizationRoot() :
this(new ConfigurationManager(), "oauth2", new RequestFactory())
{
}
public MyAuthorizationRoot(
IConfigurationManager configurationManager,
string configurationSectionName,
IRequestFactory requestFactory)
{
_requestFactory = requestFactory;
_configurationSection = configurationManager
.GetConfigSection<OAuth2ConfigurationSection>(configurationSectionName);
}
public override IEnumerable<IClient> Clients
{
get
{
var clients = base.Clients.ToList();
var googleClient = clients.FirstOrDefault(x => x.Name == "Google");
var newGoogleClient = new MyGoogleClient(_requestFactory, googleClient.Configuration);
clients.Remove(googleClient);
clients.Add(newGoogleClient);
return clients;
}
}
}
}
from oauth2.
I don't see where you are storing the extra info? I think we should add a dictionary on the user info and stick it in there. Would anyone like to take a stab at this?
from oauth2.
Related Issues (20)
- yahoo always ask for permissions when user login
- Yahoo email retriever social API
- Library use old CommonServiceLocator version HOT 3
- documention HOT 1
- Instagram Problem HOT 7
- Can Support Amazon (Login in Amazon)? HOT 1
- Initialize Client from stored token HOT 1
- Example config for .net core HOT 10
- Using OAuth2 in winforms project HOT 1
- Update GitHub OAuth Client HOT 4
- Support for HOT 1
- Help Wanted - Twitter - I can't authenticate you HOT 1
- Exception of type 'OAuth2.Client.UnexpectedResponseException' was thrown. when retrieving User info from Linked In HOT 2
- Integration for Microsoft Azure Login APIs HOT 4
- VkClient return error HOT 5
- 谷歌登录有bug HOT 1
- New Refresh Tokens are not saved when using OAuth2Client.GetCurrentTokenAsync HOT 7
- Any plans to support RestSharp v107+? HOT 2
- What is the LICENSE for this library? HOT 1
- Unable to resolve 'OAuth2 (>= 0.10.3)' for 'net8.0-windows'. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from oauth2.