예제 #1
0
 public OAuthElement(Consumer consumer, AccessToken token, XmlDocument doc)
     : base("oauth", "urn:xmpp:tmp:oauth", doc)
 {
     this.ConsumerKey     = consumer.Key;
     this.Token           = token.Token;
     this.Version         = consumer.OAuthVersion;
     this.Nonce           = OAuth.Helper.GenerateNonce();
     this.Timestamp       = OAuth.Helper.GenerateTimestamp();
     this.SignatureMethod = consumer.SignatureMethod;
 }
예제 #2
0
        public static void Main(string[] args)
        {
            if (args.Length != 2) {
                Console.WriteLine("Usage: FireEagleExample.exe consumer_key consumer_secret");
                return;
            }

            var consumer = new Consumer(args[0], args[1]) {
                Site         = "https://fireeagle.yahooapis.com",
                AuthorizeUrl = "https://fireeagle.yahoo.net/oauth/authorize"
            };

            var requestToken = consumer.GetRequestToken();

            Console.WriteLine("Visit this URL in your web browser, then press Enter:");
            Console.WriteLine(requestToken.AuthorizeUrl);
            Console.ReadLine();

            var accessToken = requestToken.ConvertToAccessToken();

            var response = consumer.Request("GET", new Uri("https://fireeagle.yahooapis.com/api/0.1/user"), accessToken);
            Console.WriteLine(response);
        }
예제 #3
0
 public AccessToken(Consumer consumer, string token, string secret)
     : base(consumer, token, secret)
 {
 }
예제 #4
0
 public RequestToken(Consumer consumer, string token, string secret)
     : base(consumer, token, secret)
 {
 }
예제 #5
0
 public ConsumerToken(Consumer consumer, string token, string secret)
     : base(token, secret)
 {
     m_Consumer = consumer;
 }