Exemplo n.º 1
0
        public static RequestToken MakeRequestForToken(string callback)
        {
            string requestTokenEndpoint = "https://www.google.com/accounts/OAuthGetRequestToken?scope=https://www.googleapis.com/auth/latitude https://www.googleapis.com/auth/userinfo.email&xoauth_displayname=JJLatitude";
              string requestTokenCallback = callback;

              var oAuthConsumer = new OAuthConsumer();
              var requestToken = oAuthConsumer.GetOAuthRequestToken(requestTokenEndpoint, null, consumerKey, consumerSecret, requestTokenCallback);

              return requestToken;
        }
Exemplo n.º 2
0
    protected void bTwitter_Click(object sender, EventArgs e)
    {
        OAuthConsumer oauth = new OAuthConsumer();

        RequestToken requestToken = new RequestToken();
        AccessToken accessToken = new AccessToken();
        //string Token = "", TokenSecret = "";

        string authUrl = GeneralUtils.GetRouteableUrlFromRelativeUrl("AuthorizeServices.aspx/twitter/");
        requestToken = oauth.GetOAuthRequestToken(appSettings["Twitter_RequestURL"],
            appSettings["Twitter_Realm"], appSettings["Twitter_ConsumerKey"], appSettings["Twitter_ConsumerSecret"],
            authUrl);

        Session["TwitterToken"] = requestToken;
        Response.Redirect(appSettings["Twitter_AuthURL"] + "?oauth_token=" + requestToken.Token);
    }