public override ICloudStorageAccessToken LoadToken(Dictionary <String, string> tokendata) { // get the credential type var type = tokendata[CloudStorage.TokenCredentialType]; if (type.Equals(typeof(DropBoxToken).ToString())) { var tokenSecret = tokendata[TokenDropBoxCredPassword]; var tokenKey = tokendata[TokenDropBoxCredUsername]; DropBoxBaseTokenInformation bc = new DropBoxBaseTokenInformation(); bc.ConsumerKey = tokendata[TokenDropBoxAppKey]; bc.ConsumerSecret = tokendata[TokenDropBoxAppSecret]; return(new DropBoxToken(tokenKey, tokenSecret, bc)); } else if (type.Equals(typeof(DropBoxRequestToken).ToString())) { var tokenSecret = tokendata[TokenDropBoxAppSecret]; var tokenKey = tokendata[TokenDropBoxAppKey]; return(new DropBoxRequestToken(new OAuthToken(tokenKey, tokenSecret))); } else { throw new InvalidCastException("Token type not supported through this provider"); } }
public override ICloudStorageAccessToken LoadToken(Dictionary<String, string> tokendata) { // get the credential type var type = tokendata[CloudStorage.TokenCredentialType]; if (type.Equals(typeof (DropBoxToken).ToString())) { var tokenSecret = tokendata[TokenDropBoxCredPassword]; var tokenKey = tokendata[TokenDropBoxCredUsername]; DropBoxBaseTokenInformation bc = new DropBoxBaseTokenInformation(); bc.ConsumerKey = tokendata[TokenDropBoxAppKey]; bc.ConsumerSecret = tokendata[TokenDropBoxAppSecret]; return new DropBoxToken(tokenKey, tokenSecret, bc); } else if (type.Equals(typeof (DropBoxRequestToken).ToString())) { var tokenSecret = tokendata[TokenDropBoxAppSecret]; var tokenKey = tokendata[TokenDropBoxAppKey]; return new DropBoxRequestToken(new OAuthToken(tokenKey, tokenSecret)); } else { throw new InvalidCastException("Token type not supported through this provider"); } }