Esempio n. 1
0
        public void ShouldGetAccessToken()
        {
            _dropBoxClient = new DropBoxClient();

            var url = _dropBoxClient.GetUrlToRequestToken("");

            _dropBoxClient.GetAccessToken();
        }
Esempio n. 2
0
        public IHttpActionResult Get()
        {
            if (_dropBoxClient.IsConnected())
            {
                return(Ok(new { Url = "", IsConnected = true }));
            }

            return(Ok(new { Url = _dropBoxClient.GetUrlToRequestToken(""), IsConnected = false }));
        }
Esempio n. 3
0
        public ActionResult Index()
        {
            var integrationsOfUser = _context.Users.GetByUserName(this.UserName).Integrations ?? new List <Integration>();

            if (integrationsOfUser.Count > 0 && integrationsOfUser.Any(i => i.IntegrationSystem == IntegrationSystem.DropBox))
            {
                return(RedirectToAction("Create", "Integration"));
            }

            ViewBag.Url = _dropBoxClient.GetUrlToRequestToken(ConfigurationManager.AppSettings["urlCallbackDropBoxAuth"]);

            Session["dropboxObject"] = Session["dropboxObject"] ?? _dropBoxClient;

            return(View());
        }