AuthorizationLinkGet() публичный Метод

Get the link to Twitter's authorization page for this application.
public AuthorizationLinkGet ( ) : string
Результат string
Пример #1
0
        protected void imgBtnLinkedIn_Click(object sender, ImageClickEventArgs e)
        {
            oAuthLinkedIn _oauth   = new oAuthLinkedIn();
            string        authLink = _oauth.AuthorizationLinkGet();

            try
            {
                Session[SessionKeys.ServiceProvider] = "LinkedIn";

                if (_oauth.Token != null && _oauth.TokenSecret != null && _oauth.Token.Length > 0 && _oauth.TokenSecret.Length > 0)
                {
                    Application["reuqestToken"]       = _oauth.Token;
                    Application["reuqestTokenSecret"] = _oauth.TokenSecret;
                    Application["oauthLink"]          = authLink;
                }
                else
                {
                    lblAlertMsg.Text = " LinkedIn keys Not Provided";
                }
            }
            catch (Exception ex)
            {
                ProcessException(ex);
            }
            if (authLink != null)
            {
                Response.Redirect(authLink);
            }
        }
Пример #2
0
        private void btnCreateAuthorization_Click(object sender, EventArgs e)
        {
            _authLink                  = _oauth.AuthorizationLinkGet();
            txtRequestToken.Text       = _oauth.Token;
            txtRequestTokenSecret.Text = _oauth.TokenSecret;

            btnAuthorize.Enabled = true;
        }
Пример #3
0
        public void linkedincompanypagetest()
        {
            oAuthLinkedIn Linkedin_oauth = new oAuthLinkedIn();
            string        authLink       = Linkedin_oauth.AuthorizationLinkGet();

            Session["reuqestToken"]       = Linkedin_oauth.Token;
            Session["reuqestTokenSecret"] = Linkedin_oauth.TokenSecret;
            Response.Redirect(authLink);
        }
Пример #4
0
        public void AuthenticateLinkedin(object sender, EventArgs e)
        {
            oAuthLinkedIn Linkedin_oauth = new oAuthLinkedIn();
            string        authLink       = Linkedin_oauth.AuthorizationLinkGet();

            Session["reuqestToken"]       = Linkedin_oauth.Token;
            Session["reuqestTokenSecret"] = Linkedin_oauth.TokenSecret;


            Response.Redirect(authLink);
        }
Пример #5
0
        public string GetLinkedinRedirectUrl(string consumerKey, string consumerSecret)
        {
            logger.Error("GetLinkedinRedirectUrl()");
            string        authLink       = string.Empty;
            oAuthLinkedIn Linkedin_oauth = new oAuthLinkedIn();

            Linkedin_oauth.ConsumerKey    = consumerKey;
            Linkedin_oauth.ConsumerSecret = consumerSecret;
            authLink = Linkedin_oauth.AuthorizationLinkGet() + "~" + Linkedin_oauth.Token + "~" + Linkedin_oauth.TokenSecret;
            //Session["reuqestToken"] = Linkedin_oauth.Token;
            //Session["reuqestTokenSecret"] = Linkedin_oauth.TokenSecret;
            return(authLink);
        }
Пример #6
0
    protected void btnCreateAuthorization_Click(object sender, EventArgs e)
    {
        string authLink = _oauth.AuthorizationLinkGet();

        Application["reuqestToken"]       = _oauth.Token;
        Application["reuqestTokenSecret"] = _oauth.TokenSecret;
        Application["oauthLink"]          = authLink;

        txtRequestToken.Text     = _oauth.Token;
        txtTokenSecret.Text      = _oauth.TokenSecret;
        hypAuthToken.NavigateUrl = authLink;
        hypAuthToken.Text        = authLink;
    }
Пример #7
0
    protected void btnLinkedInLogin_Click(object sender, EventArgs e)
    {
        ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3;
        ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls;
        string authLink = _oauth.AuthorizationLinkGet();

        Application["reuqestToken"]       = _oauth.Token;
        Application["reuqestTokenSecret"] = _oauth.TokenSecret;
        Application["oauthLink"]          = authLink;
        Session["Session_OToken"]         = _oauth.Token;
        Session["Session_OTokenSecret"]   = _oauth.TokenSecret;
        Response.Redirect(authLink);
    }
Пример #8
0
        public string GetLinkedinRedirectUrl(string consumerKey, string consumerSecret)
        {
            logger.Error("GetLinkedinRedirectUrl()");

            System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls;

            string        authLink       = string.Empty;
            oAuthLinkedIn Linkedin_oauth = new oAuthLinkedIn();

            Linkedin_oauth.ConsumerKey    = consumerKey;
            Linkedin_oauth.ConsumerSecret = consumerSecret;
            authLink = Linkedin_oauth.AuthorizationLinkGet() + "~" + Linkedin_oauth.Token + "~" + Linkedin_oauth.TokenSecret;
            //Session["reuqestToken"] = Linkedin_oauth.Token;
            //Session["reuqestTokenSecret"] = Linkedin_oauth.TokenSecret;
            return(authLink);
        }
Пример #9
0
    protected void btnLinkedInLogin_Click(object sender, CommandEventArgs e)
    {
        try
        {
            string authLink = _oauth.AuthorizationLinkGet();
            Application["reuqestToken"]       = _oauth.Token;
            Application["reuqestTokenSecret"] = _oauth.TokenSecret;
            Application["oauthLink"]          = authLink;

            Session["Session_OToken"]       = _oauth.Token;
            Session["Session_OTokenSecret"] = _oauth.TokenSecret;

            Response.Redirect(authLink);
        }
        catch (Exception ex)
        { ex.Message.ToString(); }
    }
Пример #10
0
        public void LinkedInRedirect(object sender, EventArgs e)
        {
            if (ddlGroup.SelectedItem.Text != "Select")
            {
                oAuthLinkedIn Linkedin_oauth = new oAuthLinkedIn();
                string        authLink       = Linkedin_oauth.AuthorizationLinkGet();
                Session["reuqestToken"]       = Linkedin_oauth.Token;
                Session["reuqestTokenSecret"] = Linkedin_oauth.TokenSecret;

                Session["UserAndGroupsForFacebook"] = "linkedin";
                Response.Redirect(authLink);
            }
            else
            {
                Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "test", "<script type=\"text/javascript\">alert(\"Select the group to add profiles\")</script>", false);
            }
        }
Пример #11
0
 //requestTokens
 protected void requestTokens()
 {
     //if token does not exist in filter, redirect and get token
     if (_twitterChecked)
     {
         if (_tokenFilter.twitterAuthToken == Constants.InvalidIdString || string.IsNullOrEmpty(_tokenFilter.twitterAuthToken) || _tokenFilter.twitterAuthToken == null) //if token does not exist in filter, redirect and get token
         {
             _twitterCacheKey              = _twitterCacheKeyPrefix + "-" + _requestNonce + "-" + club.clubIdString;                                                     //creates random clubid cache key
             _twitterSecretKey             = _twitterSecretKeyPrefix + "-" + _requestNonce + "-" + club.clubIdString;                                                    //uses same nonce in token cache key to create a token secret key
             oTwitter.CallBackUrl          = "http://www.clubexpress.com/basic_modules/club_admin/website/auth_callback.aspx?type=twitter&state=" + _twitterCacheKey;
             _tokenFilter.twitterCacheKey  = _twitterCacheKey;
             _tokenFilter.twitterSecretKey = _twitterSecretKey;
             _twitterString = oTwitter.AuthorizationLinkGet();
             //	Response.Write("<script>window.open('" + _twitterString + "', \"_blank\", \"toolbar=yes, scrollbars=yes, resizable=yes, width=580, height=400\");</script>");
             _popupString = _twitterString;
         }
     }
     if (_linkedInChecked)
     {
         if (_tokenFilter.linkedinToken == Constants.InvalidIdString || string.IsNullOrEmpty(_tokenFilter.linkedinToken) || _tokenFilter.linkedinToken == null)
         {
             _linkedInCacheKey             = _linkedInCacheKeyPrefix + "-" + _requestNonce + "-" + club.clubIdString;         //creates random clubid cache key
             _tokenFilter.linkedInCacheKey = _linkedInCacheKey;
             _linkedInString = oLinkedIn.AuthorizationLinkGet(_linkedInCacheKey);
             //	Response.Write("<script>window.open('" + _linkedInString + "', \"_blank\", \"toolbar=yes, scrollbars=yes, resizable=yes, width=580, height=400\");</script>");
             _popupString = _linkedInString;
         }
     }
     if (_faceBookChecked)
     {
         if (_tokenFilter.facebookToken == Constants.InvalidIdString || string.IsNullOrEmpty(_tokenFilter.facebookToken) || _tokenFilter.facebookToken == null) //if token does not exist in filter, redirect and get token
         {
             _facebookCacheKey             = _facebookCacheKeyPrefix + "-" + _requestNonce + "-" + club.clubIdString;                                           //creates random clubid cache key
             _tokenFilter.facebookCacheKey = _facebookCacheKey;
             _facebookString = oFB.AuthorizationLinkGet(_facebookCacheKey);
             //	Response.Write("<script>window.open('" + _facebookString + "', \"_blank\", \"toolbar=yes, scrollbars=yes, resizable=yes, width=580, height=450\");</script>");
             _popupString = _facebookString;
         }
     }
     if (!string.IsNullOrEmpty(_popupString))
     {
         Response.Write("<script>window.open('" + _popupString + "', \"_blank\", \"toolbar=yes, scrollbars=yes, resizable=yes, width=580, height=450\");</script>");
     }
     sessionData.addDataItem("TokenFilter", _tokenFilter);
 }
Пример #12
0
        public void AuthenticateLinkedin(object sender, EventArgs e)
        {
            try
            {
                GroupRepository        objGroupRepository = new GroupRepository();
                SocioBoard.Domain.Team team = (SocioBoard.Domain.Team)Session["GroupName"];
                Groups lstDetails           = objGroupRepository.getGroupName(team.GroupId);

                try
                {
                    int profilecount = (int)Session["ProfileCount"];
                    int totalaccount = (int)Session["TotalAccount"];
                    if (lstDetails.GroupName == "Socioboard")
                    {
                        if (profilecount < totalaccount)
                        {
                            oAuthLinkedIn Linkedin_oauth = new oAuthLinkedIn();
                            string        authLink       = Linkedin_oauth.AuthorizationLinkGet();
                            Session["reuqestToken"]       = Linkedin_oauth.Token;
                            Session["reuqestTokenSecret"] = Linkedin_oauth.TokenSecret;

                            this.LinkedInLink.HRef = "";
                            this.LinkedInLink.HRef = authLink;
                            Response.Redirect(authLink);
                        }
                        else
                        {
                            //Response.Write("<script>SimpleMessageAlert('Change the Plan to Add More Accounts');</script>");
                            ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Change the Plan to Add More Accounts');", true);
                        }
                    }
                }
                catch (Exception ex)
                {
                    logger.Error(ex.Message);
                }
            }
            catch (Exception ex)
            {
                logger.Error(ex.Message);
            }
        }
Пример #13
0
 public void AuthenticateLinkedin(object sender, EventArgs e)
 {
     try
     {
         int profilecount = (int)Session["ProfileCount"];
         int totalaccount = (int)Session["TotalAccount"];
         if (profilecount < totalaccount)
         {
             oAuthLinkedIn Linkedin_oauth = new oAuthLinkedIn();
             string        authLink       = Linkedin_oauth.AuthorizationLinkGet();
             Session["reuqestToken"]       = Linkedin_oauth.Token;
             Session["reuqestTokenSecret"] = Linkedin_oauth.TokenSecret;
             Response.Redirect(authLink);
         }
         else
         {
             Response.Write("<script>SimpleMessageAlert('Change the Plan to Add More Accounts');</script>");
         }
     }
     catch (Exception ex)
     {
         logger.Error(ex.Message);
     }
 }