titarenko / oauth2 Goto Github PK
View Code? Open in Web Editor NEWOAuth2 client implementation for .NET
OAuth2 client implementation for .NET
Your current example requires storing providerName inside Session, we are not using sessions since our app runs on load balancer. Is there anyway providerName could be specified in URL State of GetLoginLinkUri() method? and can it be retrieved in callback?
var cfg = new OAuth2.Configuration.RuntimeClientConfiguration { ClientId = "......", ClientSecret = "......" }; var auth = new OAuth2.Client.OAuth2Client (cfg); return auth.GetToken ("https://api..../accesstoken");
Please someone make a simple example, that don't involve config files and abstract class ?
I am trying to get a Yahoo client working and they make you jump through hoops to get at the profile.
protected override Endpoint UserInfoServiceEndpoint
{
get
{
return new Endpoint()
{
BaseUri = "https://social.yahooapis.com",
Resource = "/v1/user/{guid}/profile/usercard"
};
}
}
The value I need for {guid} should be returned in the Request token response but how can I can get that value at this point? I think maybe I've been looking at this too long?
Thanks, Simon
Hi,
not sure what you think would be the best approach for this, but it would be cool if the lib supported parsing of twitter username.
What I did currently is I made a custom TwitterClient class like this:
/// <summary>
/// This class is used to override the original TwitterClient's ParseUserInfo() method, to
/// get the twitter username instead of first/last name which we're not using in our app.
/// </summary>
public class CustomTwitterClient : TwitterClient
{
public CustomTwitterClient(IRequestFactory factory, IClientConfiguration configuration) : base(factory, configuration)
{
}
protected override UserInfo ParseUserInfo(string content)
{
var response = JObject.Parse(content);
var avatarUri = response["profile_image_url"].Value<string>();
return new UserInfo
{
Id = response["id"].Value<string>(),
Email = null,
// NOTE: here we're setting the screen_name (username) as firstName if we
// ever need the firstName, we'll have to handle the parsing differently
FirstName = response["screen_name"].Value<string>(),
AvatarUri =
{
Small = avatarUri.Replace("normal", "mini"),
Normal = avatarUri,
Large = avatarUri.Replace("normal", "bigger")
}
};
}
}
Which I then use in the AccountController
to handle twitter registration through oauth. I don't see us using the FirstName or the LastName at all so I simply set the screen_name as FirstName. It's a dirty hack but I didn't feel like overriding any additional classes (UserInfo
, OauthClient
, and possibly a few more) just to get the userName with oauthClient.GetUserInfo()
.
So perhaps with a few more generic and/or virtual methods (GetUserInfo
, and ParseUserInfo
this could be done in a slightly cleaner way). Or if the UserInfo
class had a UserName property, in my opinion that would be good enough as well - we would be able to use a custom parser without messing with other properties and mapping them to something else.
What do you think?
If not, mind if I play with creating one?
In case of Windows Live client the profile photo is not valid. The avatar photo Url points to a target where there is no photo.
I see some complex Url combination logic in WindowsLiveClient.cs. Will it work for users who integrated their Windows 8, 8.1 with their live account?
You should use something like that: https://apis.live.net/v5.0/{0}/picture
where {0} is the userId.
Related documentation: http://msdn.microsoft.com/en-us/library/live/hh243648.aspx
Facebook avatar Urls that are provided by Oauth2 point to very small images even the Large ones.
The following call will give the correct profile photo Url:
https://graph.facebook.com/{0}/picture?type={1}
where {0} is the user id and {1] is the type (small, normal, large).
According to this there is a better method:
https://developers.facebook.com/docs/graph-api/reference/user/picture/
Integrate implementation received from Krisztián Pócza.
Because the redirect url is preconfigured how can we ensure the user user is redirected back to their original url? Is the only way to store something in session prior to the login?
Aside from this thanks so much for sharing as I've had a nightmare trying to get a working OAuth2 solution to fit into an existing app. I've written a Yahoo provider also now so will send a pull request when I'm finished.
Thanks, Simon
Create acceptance tests using browser automation to ensure each and every client is fully working.
Hey,
I see that some users are getting exception from the OAuth2 client. Havnt managed to reproduce it on my accounts , But its there. Have seen it both on facebook and google accounts. Here is a stacktrace of a facebook faild attempt.
Newtonsoft.Json.JsonReaderException: Error reading JObject from JsonReader. Path '', line 0, position 0.
at Newtonsoft.Json.Linq.JObject.Load(JsonReader reader)
at Newtonsoft.Json.Linq.JObject.Parse(String json)
at OAuth2.Client.Impl.FacebookClient.ParseUserInfo(String content)
at OAuth2.Client.OAuth2Client.GetUserInfo(String accessToken)
at OAuth2.Client.OAuth2Client.GetUserInfo(NameValueCollection parameters)
`"Could not load file or assembly 'Autofac, Version=2.6.3.862, Culture=neutral, PublicKeyToken=17863af14b0044da' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)"
=== Pre-bind state information ===
LOG: DisplayName = Autofac, Version=2.6.3.862, Culture=neutral, PublicKeyToken=17863af14b0044da
(Fully-specified)
LOG: Appbase = file:///C:/Users/briod/Desktop/OAuthTest/OAuth2/Oauth2/OAuth2.Example/
LOG: Initial PrivatePath = C:\Users\briod\Desktop\OAuthTest\OAuth2\Oauth2\OAuth2.Example\bin
Calling assembly : Autofac.Integration.Mvc, Version=2.6.3.862, Culture=neutral, PublicKeyToken=17863af14b0044da.
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Users\briod\Desktop\OAuthTest\OAuth2\Oauth2\OAuth2.Example\web.config
LOG: Using host configuration file: C:\Users\briod\Documents\IISExpress\config\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: Autofac, Version=2.6.3.862, Culture=neutral, PublicKeyToken=17863af14b0044da
LOG: Attempting download of new URL file:///C:/Users/briod/AppData/Local/Temp/Temporary ASP.NET Files/vs/e002a6b1/3f91f652/Autofac.DLL.
LOG: Attempting download of new URL file:///C:/Users/briod/AppData/Local/Temp/Temporary ASP.NET Files/vs/e002a6b1/3f91f652/Autofac/Autofac.DLL.
LOG: Attempting download of new URL file:///C:/Users/briod/Desktop/OAuthTest/OAuth2/Oauth2/OAuth2.Example/bin/Autofac.DLL.
WRN: Comparing the assembly name resulted in the mismatch: Major Version
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.`
the new downloaded Autofac.DLL has newer version 3.5.2.
I want to fetch refresh token along with access token. So it would have been better if a method to fetch refresh token was provided.
I'm getting two exceptions lately with the GitHub GetUserInfo method:
System.ArgumentNullException: Value cannot be null. Parameter name: source
at Newtonsoft.Json.Linq.Extensions.Value[T,U](System.Collections.Generic.IEnumerable`1 value) at offset 21
at OAuth2.Client.Impl.GitHubClient.ParseUserInfo(System.String content) at offset 7
at OAuth2.Client.OAuth2Client.GetUserInfo at offset 112
and
System.NullReferenceException: Object reference not set to an instance of an object.
at OAuth2.Client.Impl.GitHubClient.ParseUserInfo(System.String content) at offset 7
at OAuth2.Client.OAuth2Client.GetUserInfo at offset 112
As said in http://instagram.com/developer/authentication/ we have to use POST request instead GET. As I see in your RequestFactoryExtensions.CreateRequest creates only GET requests. Can you adjust to use POST requests to Instagram access_token requests?
Sorry, the problem is in getUserInfo endpoint. It is incorrect. And this request needs to be invoked with url parameter "acces_token". Can you fix this problem? I realy need in it. Thanks.
Throw exception to indicate that configuration is incomplete (for example, ClientId is missing).
Hi, I've successfully connected to google and facebook, but have problems with LinkedIn, Live and Twitter.
Windows Live: it redirects me to login.live, which displays "We're unable to complete your request"
LinkedIn is failing on RedirectResult(), with uri - https://www.linkedin.com/uas/oauth2/authorization?response_type=code&client_id={guid}&redirect_uri=http:%2F%2Flocalhost:6260%2Fauth&scope=&state=626ba52acf754d79942422c4fd884b6f
Twitter: I've got Exception of type 'OAuth2.Client.UnexpectedResponseException' was thrown. here is stack trace:
[UnexpectedResponseException: Exception of type 'OAuth2.Client.UnexpectedResponseException' was thrown.]
OAuth2.Infrastructure.RestClientExtensions.ExecuteAndVerify(IRestClient client, IRestRequest request) +130
OAuth2.Client.OAuthClient.QueryRequestToken() +245
OAuth2.Client.OAuthClient.GetLoginLinkUri(String state) +35
Oauth2Test.Controllers.HomeController.Login(String providerName) +215
lambda_method(Closure , ControllerBase , Object[] ) +127
System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary2 parameters) +242 System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary
2 parameters) +39
System.Web.Mvc.Async.AsyncControllerActionInvoker.b__39(IAsyncResult asyncResult, ActionInvocation innerInvokeState) +12
System.Web.Mvc.Async.WrappedAsyncResult2.CallEndDelegate(IAsyncResult asyncResult) +139 System.Web.Mvc.Async.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3d() +112 System.Web.Mvc.Async.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() +452 System.Web.Mvc.Async.<>c__DisplayClass33.<BeginInvokeActionMethodWithFilters>b__32(IAsyncResult asyncResult) +15 System.Web.Mvc.Async.<>c__DisplayClass2b.<BeginInvokeAction>b__1c() +37 System.Web.Mvc.Async.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult) +241 System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState) +29 System.Web.Mvc.Async.WrappedAsyncVoid
1.CallEndDelegate(IAsyncResult asyncResult) +111
System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +53
System.Web.Mvc.Async.WrappedAsyncVoid1.CallEndDelegate(IAsyncResult asyncResult) +19 System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState) +51 System.Web.Mvc.Async.WrappedAsyncVoid
1.CallEndDelegate(IAsyncResult asyncResult) +111
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +606
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +288
It seems like we are getting a lot of valuable information returned by our user info responses and we throw it away like a list of all their email addresses, sex/age and much more... It would be nice if this was shredded and anything that we didn't know about was placed in key value pairs on a userinfo data property.
I'd be more than happy to pair on this functionally..
I'm trying to get my Twitter login working and after a few teething issues such as making sure the Twitter app has a Callback URL I got it to the point where the callback is made however it is failing because the response is missing the "code" parameter in the callback. What is returned is oauth_token and oauth_verifier.
Is there something else I am missing?
Thanks, this project has been a big help to me so far!
First of all, guys you build the great thing. I really like OAuth2 and its idea of being as simple and easy to use as possible. Thank you for this.
I'd like to propose some changes which I believe won't make the entire solution more complicated, but will enable few other use-cases.
As a distributed web-solution developer, I want my service layer to be designed as a standalone web API. This API will provide authentication methods like:
POST /AuthenticateWithGoogle/?accessToken={accessToken}
POST /AuthenticateWithFacebook/?accessToken={accessToken}
etc.
These methods will provide a session token
which the service users will then use to tell the service who they are when they want to access the API:
GET /Dashboard/?sessionToken={sessionToken}
In this scenario, front-end (be it a web application or mobile client) is responsible for getting the google access token and then providing it to web API for authentication. Service behind web API will use this token to understand if or not we already have this user registered, create/update this user's details, etc.
I would really love OAuth2 library to provide a simple API to independently "authenticate and get access token" and "use access token to get user details". Based on the code I've seen, everything is already there, but it's just not a part of user API. Here's a pseudo code snippet:
// Web application
public ActionResult RedirectToGoogleAuthentication()
{
return Redirect(_googleClient.GetAuthenticationUri());
}
public ActionResult GoogleAuthenticationCallback(string code)
{
var accessToken = _googleClient.GetAccessToken(code);
var serviceAuthResult = _myService.AuthenticateWithGoogle(accessToken);
// DONE!
}
// Web API
public AuthenticationResult AuthenticateWithGoogle(string accessToken)
{
// _googleClient is either OAuth2's GoogleClient or something hand-made
var userDetails = _googleClient.GetUserInfo(accessToken);
var user = _authenticationService.GetOrCreateUserByGoogleUserId(userDetails.Id);
return StartSessionForUser(user);
}
Write at least basic documentation on internals of OAuth2 library implementation.
I created a new Google OAuth Credential, set the client ID and secret in the web.config file.
When I run the example application, I get an InvalidCastException on the following line:
AccessToken = (string) ParseTokenResponse(response.Content, AccessTokenKey);
Additional information: Unable to cast object of type 'Newtonsoft.Json.Linq.JValue' to type 'System.String'.
The OAuth response from Google was:
{
"access_token" : "ya29.kwEojw5CBL9Q-sDriuCMp8vu9AmC0MBc5jXNb2ZjRElYqxxK191x5HhPjrEkKDG4regV2hhQ5Rp0dg",
"token_type" : "Bearer",
"expires_in" : 3596,
"id_token" : "eyJhbGciOiJSUzI1NiIsImtpZCI6IjQyZWJmNWQ2OGI2YzQ3ODQ2YTU1OTM4ZTZmMTY1NzlmYjlhZmJhZTMifQ.eyJpc3MiOiJhY2NvdW50cy5nb29nbGUuY29tIiwic3ViIjoiMTEyMjE1NDE0NjczNjAyOTU2MjUzIiwiYXpwIjoiMTU2MTMwMzk0ODA0LXVtdXExOXZnaXI1aXE0c2I0dXBvdXQxbzNwcmVlOWtkLmFwcHMuZ29vZ2xldXNlcmNvbnRlbnQuY29tIiwiZW1haWwiOiJzYW1ia25pZ2h0QGdtYWlsLmNvbSIsImF0X2hhc2giOiJsdkNmUTJsRUNVUlFBbTVuSmlOZTFnIiwiZW1haWxfdmVyaWZpZWQiOnRydWUsImF1ZCI6IjE1NjEzMDM5NDgwNC11bXVxMTl2Z2lyNWlxNHNiNHVwb3V0MW8zcHJlZTlrZC5hcHBzLmdvb2dsZXVzZXJjb250ZW50LmNvbSIsImlhdCI6MTQzNDM3MTM5NiwiZXhwIjoxNDM0Mzc0OTk2fQ.Etqr_U7derEAwjqcfnE3u8ozpViLvIftUlgtdvWcqgGtOO9OOi_BqYcPZT08dYzPMCtRkofgix7m6gV0mVtYHCkfLg0_gY1cqm7VdRu07LD2F0mNjgXOo406E8LRCScEyi2jcUf_1zNSAgtMyB2VAuzzNzkS4BXkRI0bvrKrlfrUL1SusBK32loIw9ItTe5peDIS1nWYmEqC-O28RtFvd_F8sLzpQQJo67x1k8Z-hOj-Hd4QmlUGWW1BExTzW4MeiHi5Q3IaWoqKiCPiEBaDI2DaJmVZMDIkC-t9g_MNYjsiUMIBRbgQ6GBCQLk28DCulhwCDUutAM-ZThLxonevoA"
}
The fix here that works for me is to amend ParseTokenResponse to return token.ToString()
The next issue is the following:
if (GrantType != "refresh_token")
RefreshToken = (string) ParseTokenResponse(response.Content, RefreshTokenKey);
The RefreshToken assignment line throws a NullReferenceException
in ParseTokenResponse
-
var token = JObject.Parse(content).SelectToken(key);
if (token.ToString().IsEmpty())
The exception happens on token.ToString()
as token is null.
how to get success status code after successful login? Is there any success code will be returned to the redirect uri. If anything how to get?
We should assume that every client field is optional so bugs like: #66 (comment) don't occur.
So I get a JSON parse error when I'm using OAuth2. Any idea what might be going on?
I am implementing facebook integration on my site and wanna have access to the Facebook Client Configuration outside OAuth library for using it with Facebook SDK.
С недавних пор ВКонтакте стал отдавать email пользователя, если он разрешает.
Пока ваша библиотека возвращает email=null.
There is an issue when updating to 105 of restsharp ( restsharp/RestSharp#595 ). I think the only thing that needs to be done is the code needs to pull the new restsharp package and recompile.
Exception of type 'OAuth2.Client.UnexpectedResponseException' was thrown.
version OAuth2 0.8.29 from nuget
Is it possible to have a use sample? I'm new to the whole web development and I'm doing a personal project. I have already installed the package and modified the web.config, but I'm lost in how to implement it.
If I'm instructed on how to use it, I wouldn't mind creating some documentation for future references and posting it here.
Do not allow obscure exceptions like this. Do necessary check after receiving response from endpoint.
Newtonsoft.Json.JsonReaderException: Error reading JObject from JsonReader. Path '', line 0, position 0.
at Newtonsoft.Json.Linq.JObject.Load(JsonReader reader)
at Newtonsoft.Json.Linq.JObject.Parse(String json)
at OAuth2.Client.Impl.FacebookClient.ParseUserInfo(String content)
at OAuth2.Client.OAuth2Client.GetUserInfo(String accessToken)
at OAuth2.Client.OAuth2Client.GetUserInfo(NameValueCollection parameters)
(Not really an "issue" per se, more like a question or request.)
OAuth2 is really great. Its so much easier than any of the alternatives.
However, Im having a hard time understanding how I should add custom endpoints, not how I should but how the original developers had in mind for me to do it.
Anyway, an example would be great, it would really make it easier for new developers to use this easy and straight forward library.
Many thanks.
This is new feature request to implement async await pattern for Client token authorization.
The example project is attempting to access the Session during Application Start. This is throwing a "Session state is not available in this context." HttpException.
Please remove
flickr
and add
LinkedIn
WindowsLive
Хотелось бы иметь возможность получаться информацию о пользователе только при помощи Access token. Например, если я использую библиотеку при создании API для мобильного приложения. В самом приложении происходит авторизация, где получаем access token.
Сейчас получить данные можно только через QueryString.
I would like to be able to obtain information about the user only through Access token. For example, if I use the API library when creating mobile applications. In the application there is authorization, which obtain access token.
Now you get the data only through the QueryString.
How are people handling the scenario where someone chooses a login service, gets redirected to the service login page and then decides to cancel the process. Currently an exception of type 'OAuth2.Client.UnexpectedResponseException' is thrown but that doesn't really handle the situation.
Thanks
I have seen ASP.NET MVC's default OAuth login system, they do not require any clientID, secrete for Google, how can same be achieved with your library?
I'm trying to use OAuth2 0.8.25 (the latest one in NuGet). Here's my GoogleClient configuration:
<add clientType="GoogleClient"
enabled="true"
clientId="GOODCLIENTIDHERE"
clientSecret="GOODCLIENTSECRETHERE"
scope="https://www.googleapis.com/auth/userinfo.email"
redirectUri="~/Home/AuthCallback" />
Here's where it fails:
var userInfo = googleClient.GetUserInfo(Request.QueryString);
Here's where I am after authentication:
http://localhost/OAuth2Experiment/Home/AuthCallback?code=4/JRhtJvR3WzaZWhR6jHD0ZzCFSdOP.gpR9X3xcBGcRsNf4jSVKMpZw1hfVgAI
Here's a stacktrace:
[ArgumentNullException: Value cannot be null.
Parameter name: source]
Newtonsoft.Json.Linq.Extensions.Value(IEnumerable`1 value) +112
OAuth2.Client.Impl.GoogleClient.ParseUserInfo(String content) +125
OAuth2.Client.OAuth2Client.GetUserInfo() +175
OAuth2.Client.OAuth2Client.GetUserInfo(NameValueCollection parameters) +77
OAuth2Experiment.Controllers.HomeController.AuthCallback() in c:\dev\OAuth2Experiment\OAuth2Experiment\Controllers\HomeController.cs:35
lambda_method(Closure , ControllerBase , Object[] ) +62
System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +14
System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +211
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +27
System.Web.Mvc.Async.<>c__DisplayClass42.<BeginInvokeSynchronousActionMethod>b__41() +28
System.Web.Mvc.Async.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _) +10
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +57
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) +48
System.Web.Mvc.Async.<>c__DisplayClass39.<BeginInvokeActionMethodWithFilters>b__33() +57
System.Web.Mvc.Async.<>c__DisplayClass4f.<InvokeActionMethodFilterAsynchronously>b__49() +223
System.Web.Mvc.Async.<>c__DisplayClass37.<BeginInvokeActionMethodWithFilters>b__36(IAsyncResult asyncResult) +10
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +57
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) +48
System.Web.Mvc.Async.<>c__DisplayClass2a.<BeginInvokeAction>b__20() +24
System.Web.Mvc.Async.<>c__DisplayClass25.<BeginInvokeAction>b__22(IAsyncResult asyncResult) +102
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +57
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +43
System.Web.Mvc.<>c__DisplayClass1d.<BeginExecuteCore>b__18(IAsyncResult asyncResult) +14
System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +23
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +57
System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +23
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +47
System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) +10
System.Web.Mvc.<>c__DisplayClass8.<BeginProcessRequest>b__3(IAsyncResult asyncResult) +25
System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +23
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +47
System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +9634212
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
LinkedIn has already moved to oauth2. I have written the oauth2 client, but they have different parameter name for the oauth_token (oauth2_access_token). OAuth2UriQueryParameterAuthenticator class should have the ability to get the name for the parameter!
In case you give me the rights to repository i can do this.
Link to the linkedin api: http://developer.linkedin.com/documents/authentication
Check response for errors, to avoid obscure exceptions like following:
[NullReferenceException: Object reference not set to an instance of an object.]
RestSharp.RestClient.EncodeParameters(IRestRequest request) +556
RestSharp.RestClient.BuildUri(IRestRequest request) +1615
OAuth2.Client.OAuthClient.GetLoginRequestUri(NameValueCollection response, String state) +844
OAuth2.Client.OAuthClient.GetLoginLinkUri(String state) +79
It would be very useful to have a way to pass "State" parameter to login uri and get it back after auth.
[NullReferenceException: Object reference not set to an instance of an object.]
RestSharp.RestClient.EncodeParameters(IRestRequest request) +556
RestSharp.RestClient.BuildUri(IRestRequest request) +1615
OAuth2.Client.OAuthClient.GetLoginRequestUri(NameValueCollection response, String state) +844
OAuth2.Client.OAuthClient.GetLoginLinkUri(String state) +79
First, thanks for the great implementation of OAuth2. First package I found that was easy to reuse for different providers.
Is there a way to remove the System.Web Dependency in UriUtility.cs. Just wondering if anyone has done it already?
I would like to use this with Nancy if possible. Works great in our MVC website, but need it for a Nancy installation.
Hi Constantin, will you update the Nuget package to v 0.8.28?
Thanks,
Juan
Perform code review. Delete dead code. Refactor unclean things. Make sure test coverage is good.
Currently it is not possible to add your own custom clients from your own assembly. This means that unless it is an existing client native to this project you have to create a custom build of the project. I've forked the project and made a small change to allow discovery of clients in other assemblies and will initiate a pull request shortly for consideration.
Thanks, Simon
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.