Esempio n. 1
0
        public async Task<JObject> GetMetaData(DropboxModel model)
        {
            var identity = (BluePillIdentity)ControllerContext.HttpContext.User.Identity;
            var content = await _dropbox.GetMetaData(identity.AccessToken);

            return content;
        }
Esempio n. 2
0
        public async Task<ActionResult> GetAccessToken(DropboxModel model)
        {
            var token = await _dropbox.RequestAccessToken(model.AuthorizationToken, model.AuthorizationSecret);

            model.AccessToken = token[Keys.TOKEN];
            model.AccessSecret = token[Keys.SECRET];

            var identity = (BluePillIdentity)ControllerContext.HttpContext.User.Identity;
            _storage.AddToken(new Token { UserId = identity.Name, Value = token[Keys.TOKEN], Secret = token[Keys.SECRET] });

            return View("Index", model);
        }
Esempio n. 3
0
        public async Task<ActionResult> Index()
        {
            var token = await _dropbox.RequestAuthorizationToken();

            var model = new DropboxModel
            {
                AuthorizationToken = token[Keys.TOKEN],
                AuthorizationSecret = token[Keys.SECRET],
                AuthorizationUrl = _dropbox.GetAuthorizationUrl(token[Keys.TOKEN], token[Keys.SECRET])
            };

            var identity = (BluePillIdentity)ControllerContext.HttpContext.User.Identity;

            return View(model);
        }