English 中文(简体)
How to use RestSharp with OAuth?
原标题:

I am confused which factory OAuth1Authenticator factory method should I use. I think I should get a consumer secret token (can I get it with RestSharp?), then use OAuth1Authenticator.ForRequestToken, then obtain access token and secret access token(how?), then use OAuth1Authenticator.ForAccessToken and use the return value from this point forward.

But it seems that RestSharp is architectured to use the only one authenticator and I can t seem to find a way from a cold start (having only app token) to having all the necessary credentials (consumer key and secret, access key and secret).

Bonus questions:

  1. What .ForClientAuthentication and .ForProtectedResource methods are for?
  2. Why OAuth2Authenticatior is in a different namespace from OAuth1Authenticator?
最佳回答

OAuth 1 is multi-step, so you have to use a different static method each step of the way. There s an example here: https://github.com/restsharp/RestSharp/blob/master/test/RestSharp.IntegrationTests/OAuth1Tests.cs

问题回答

暂无回答




相关问题
Cannot get Twitter-OAuth-iPhone to work

demo works as expected, no problems. But now I m trying to integrate it into my project. I use no xib-s, code only: OAuthTwitterDemoViewController *vc = [[OAuthTwitterDemoViewController alloc] init]; ...

Library for OAuth Provider (Java) [closed]

I m looking for a Java library that helps me building an OAuth Provider. I must be able to receive OAuth signed requests and determine whether they are valid or not (checking the signature, timestamp ...

twitter status update using tweetsharp oauth preview 17

I am trying to update the status using tweetsharp oauth preview 17. Please let me know how ?. I tried this code var msg = FluentTwitter.CreateRequest() .AuthenticateWith(_consumerKey, ...

How to keep RoleProvider from overriding custom roles?

I have an custom role provider that gets the roles a user belongs to from a database. I also have a custom authentication module registered in my web.config s httpModules which sniffs incoming HTTP ...

How to test the twitter API locally?

I m trying to write a web application that would use Twitter via OAuth. I run my local server as localhost , so I need the callback URL to be something like http://localhost/something/twitter.do ...

o和使用

i 一旦从山角到用户接触,我会感到非常混乱,

oauth problem( app engine)

i am trying to pull user s documents data from google docs using oauth, but i cannot understand how to do it - what s the purpose of oauth_verifier - how to get the access token secret? - if i try to ...

热门标签