Error

May 9, 2011 at 2:38 AM

Hello.

I went to the DropBox website, made a new app and got a key. Then I entered my email (wc3battlemaster1@gmail.com, it's my dropbox login), my pass, the key and the secret I got. But when I try to open storage, I get this:

"Attempted to perform an unauthorized operation."

I don't understand this, please help me.

Coordinator
May 10, 2011 at 2:30 PM
Hi,

I tried this a couple weeks ago and it worked. Do you have more information? Did it work with the official SDK code in python or so? Try the workflow from our trunk which supports web apps: http://sharpbox.codeplex.com/discussions/255775

Thanks
Dirk

2011/5/9 Battlemaster2 <notifications@codeplex.com>

From: Battlemaster2

Hello.

I went to the DropBox website, made a new app and got a key. Then I entered my email (wc3battlemaster1@gmail.com, it's my dropbox login), my pass, the key and the secret I got. But when I try to open storage, I get this:

"Attempted to perform an unauthorized operation."

I don't understand this, please help me.

Read the full discussion online.

To add a post to this discussion, reply to this email (sharpbox@discussions.codeplex.com)

To start a new discussion for this project, email sharpbox@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


May 11, 2011 at 3:04 AM

Maybe I just filled out the credentials wrong.

Am I supposed to go to the DropBox website, make a new app, then get a key for it and put that key and secret in? I also put my email I registered for DropBox with and my pass for DropBox.

Also do I need to do anything with the new app in the developers section of DropBox?

Thanks for the reply.

Coordinator
May 15, 2011 at 7:26 AM
Hi,

no thats all. Nothing more :-)

Dirk

2011/5/11 Battlemaster2 <notifications@codeplex.com>

From: Battlemaster2

Maybe I just filled out the credentials wrong.

Am I supposed to go to the DropBox website, make a new app, then get a key for it and put that key and secret in? I also put my email I registered for DropBox with and my pass for DropBox.

Also do I need to do anything with the new app in the developers section of DropBox?

Thanks for the reply.

Read the full discussion online.

To add a post to this discussion, reply to this email (sharpbox@discussions.codeplex.com)

To start a new discussion for this project, email sharpbox@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


May 23, 2011 at 6:54 AM

Hi,

I also have the same problem. I did the exact same thing. I have not downloaded the Dropbox application as I just wanted to get started with the API first. I am using SharpBox-1.0.3-261.zip (fx40) assembly. I have the following code which is generating "Attempted to perform an unauthorized operation" exception

public Boolean EnumerateDropbox(String userName, String password)
        {
            Boolean successful = true;
            CloudStorage cloudStorage = new CloudStorage();

            try
            {
                successful = LoginToDropboxUsingCredentials(userName, password, cloudStorage);
                if (successful)
                {
                    EnumerateFilesAndFolders(cloudStorage);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error = {0}", ex.Message);
                successful = false;
            }
            finally
            {
                // close the cloud storage connection
                if (cloudStorage.IsOpened)
                {
                    cloudStorage.Close();
                }
            }

            return successful;
        }

private Boolean LoginToDropboxUsingCredentials(String userName, String password, CloudStorage cloudStorage)
        {
            Boolean successful = false;

            // Set consumer app key and token
            DropBoxCredentials credentials = new DropBoxCredentials();
            credentials.ConsumerKey = _appKey;
            credentials.ConsumerSecret = _secretToken;

            // Set the account details
            credentials.UserName = userName;
            credentials.Password = password;

            // Instantiate a cloud storage configuration
            DropBoxConfiguration configuration = DropBoxConfiguration.GetStandardConfiguration();

            try
            {
                ICloudStorageAccessToken iAccessToken = null;
                iAccessToken = cloudStorage.Open(configuration, credentials);

                if (iAccessToken != null)
                {
                   successful = true;
                }
            }
            catch (SharpBoxException shEx)
            {
                Console.WriteLine("Error Code = {0}", shEx);
                successful = false;
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error = {0}", ex.Message);
                successful = false;
            }
            return successful;
        }
I have provided correct values for ConsumerKey, ConsumerSecret, DropBox login credentials for Username & password. The line that is raising this exception is 

iAccessToken = cloudStorage.Open(configuration, credentials);

 

Am I missing something?

May 23, 2011 at 10:14 AM

Hi Dirk,

Please ignore the earlier post. It turned out that the network calls were being blocked because of some company network policies.

Regards,

Saju