Authentication using OAuth2

2,351 views
Skip to first unread message

Puja parajuli

unread,
Oct 10, 2011, 7:50:21 AM10/10/11
to RestSharp
Hi Everyone,

I have just started working with RestSharp.
I want to use it to authenticate but i can see only
OAuth1Authenticator. Can i use Restsharp to
authenticate OAuth2 protocol ?

Any help with be appreciated.

Regards
Puja

prabir

unread,
Oct 10, 2011, 8:25:30 AM10/10/11
to rest...@googlegroups.com
I remember contributing the oauth2 authenticator for restsharp and was accepted. not sure if its still there.
 
from my experience, its better to write your own authenticator, or much easier just add querystring or the oauth 2 authenticator header. The reason I say is that oauth 2 hasn't be finialized and are not consistent with other oauth2 providers.
Some requires to add ?access_token=... , oauth_token=..... or bearer_token=.....
Since it's just matter of adding one querystring parameter, it is better to consult the api documentation and add it manually.
 
There has already been around 22 oauth2 drafts. even Facebook is on draft 20. so I think its better not to expect the oauth 2 as part of RestSharp anytime soon.
 
Another problem is for exchaning code for access token and other oauth2 features. Facebook returns a non-json result, Google returns a json result. Since its all messed up it is better to implement what the documentation says instead of trying to generalize oauth2 in RestSharp.

Puja parajuli

unread,
Oct 10, 2011, 8:50:57 AM10/10/11
to rest...@googlegroups.com
Hi,
Thanks a lot for the info....

Regards
Puja

2011/10/10 prabir <prabirs...@yahoo.com>

John Sheehan

unread,
Oct 11, 2011, 1:01:20 AM10/11/11
to rest...@googlegroups.com

John Sheehan

unread,
Oct 11, 2011, 1:01:50 AM10/11/11
to rest...@googlegroups.com
Oops wrong link, but there's an OAuth2Authenticator in there as Prabir mentioned.

Puja parajuli

unread,
Oct 11, 2011, 4:19:28 AM10/11/11
to rest...@googlegroups.com
I got the point .... thanks 

2011/10/11 John Sheehan <johns...@gmail.com>
Reply all
Reply to author
Forward
0 new messages