public static void Update(OAuthToken refreshAccessToken)
        {
            var testConfigInfo = Get();
            testConfigInfo.AccessToken = refreshAccessToken.AccessToken;
            testConfigInfo.RefreshToken = refreshAccessToken.RefreshToken;

            using (var stream = TestConfigFileInfo().Open(FileMode.Truncate))
            {
                using (var writer = new StreamWriter(stream))
                {
                    var updatedInfo = new JsonSerializer().Serialize(testConfigInfo);
                    writer.Write(updatedInfo);
                }
            }
        }
Example #2
0
        /// <summary>
        /// Authorizes an AccessToken and recieves the Bearer Token.
        /// </summary>
        /// <param name="AccessToken">String that will be displayed on the Dropbox site after authorizating an application with user account</param>
        /// <returns>True if Token was authroized successfully, False elsewhere</returns>
        public bool AuthorizeToken(string AccessToken)
        {
            if (authProvider == null)
            {
                authProvider = new TokenProvider(CLIENT_ID, CLIENT_SECRET);
            }
            this.Token = authProvider.GetAccessToken(AccessToken, CLIENT_RETURN_URL);

            return true;
        }
Example #3
0
 public BOXApi(OAuthToken token)
 {
     this.Token = token;
     client = new BoxManager(Token.AccessToken);
 }
Example #4
0
 public bool RefreshToken()
 {
     this.Token = authProvider.RefreshAccessToken(this.Token.RefreshToken);
     return true;
 }