xamarin/Xamarin.Auth — pull request #30 by gaearon (2013-06-04 21:22:35+00:00)
Title: Make OAuth 1 header generation overridable

(Licensed under MIT/X11)

Basically, we needed to extract `GetAuthorizationHeader` and make it `virtual` to implement Twitter Reverse Auth:

class ReverseAuthRequest : OAuth1Request {
private string consumerKey;
private string consumerSecret;

public ReverseAuthRequest (Account account, string consumerKey, string consumerSecret)
: base (
"GET",
new Uri ("https://api.twitter.com/oauth/request_token"),
new Dictionary { { "x_auth_mode", "reverse_auth" } },
account
)
{
this.consumerKey = consumerKey;
this.consumerSecret = consumerSecret;
}

protected override string GetAuthorizationHeader ()
{
return OAuth1.GetAuthorizationHeader (
Method,
Url,
new Dictionary (Parameters),
this.consumerKey,
this.consumerSecret,
string.Empty,
string.Empty
);
}
}

https://dev.twitter.com/docs/ios/using-reverse-auth

Reverse Auth is essential if you're using Twitter.framework or Social.framework and want to verify account on server before signing the user in.