This project is read-only.

Avoiding Browsing To AuthenticationUrl

Oct 24, 2011 at 7:21 AM

Using the AppLimit.CloudComputing.SharpBox.DropBoxApplicationAuthorization2010, I was able to determine that to authenticate using DropBox API Version 1 requires the following code:

            // 1. Setup Configuration            
            UsedConfig = DropBoxConfiguration.GetStandardConfiguration();
            UsedConfig.APIVersion = DropBoxAPIVersion.V1;

            // 2. Obtain the request token
            CurrentRequestToken = DropBoxStorageProviderTools.GetDropBoxRequestToken(UsedConfig, Key, Secret);

            // 3. Retrieve the authorization url 
            string authUrl = DropBoxStorageProviderTools.GetDropBoxAuthorizationUrl(UsedConfig, CurrentRequestToken);

            //******************************//
            // Browse to authURL in browser //
            //******************************//
            
            // 5. Convert request token to real token
            GeneratedToken = DropBoxStorageProviderTools.ExchangeDropBoxRequestTokenIntoAccessToken(UsedConfig, Key, Secret, CurrentRequestToken);

            // 6. Open the clout storage
            CloudStorage cs = new CloudStorage();
            ICloudStorageAccessToken token = cs.Open(UsedConfig, GeneratedToken);

            Assert.IsNotNull(token);

However, notice the "Browse to authURL in browser" piece.  How do I do this programmatically?  I attempted to use System.Net.WebClient but that failed. 

Thanks,
Mark

 

Oct 24, 2011 at 7:51 AM
Hi,

you should use a Webbrowser Control when you create the token. The generated token can be reused as often as you want to without web browser. Did you check our tutorial for this? http://www.codeplex.com/Download?ProjectName=sharpbox&DownloadId=287249

Cheers
Dirk

Sent from my iPad

On 24.10.2011, at 08:21, MarkMichaelis <notifications@codeplex.com> wrote:

From: MarkMichaelis

Using the AppLimit.CloudComputing.SharpBox.DropBoxApplicationAuthorization2010, I was able to determine that to authenticate using DropBox API Version 1 requires the following code:

            // 1. Setup Configuration            
            UsedConfig = DropBoxConfiguration.GetStandardConfiguration();
            UsedConfig.APIVersion = DropBoxAPIVersion.V1;

            // 2. Obtain the request token
            CurrentRequestToken = DropBoxStorageProviderTools.GetDropBoxRequestToken(UsedConfig, Key, Secret);

            // 3. Retrieve the authorization url 
            string authUrl = DropBoxStorageProviderTools.GetDropBoxAuthorizationUrl(UsedConfig, CurrentRequestToken);

            //******************************//
            // Browse to authURL in browser //
            //******************************//
            
            // 5. Convert request token to real token
            GeneratedToken = DropBoxStorageProviderTools.ExchangeDropBoxRequestTokenIntoAccessToken(UsedConfig, Key, Secret, CurrentRequestToken);

            // 6. Open the clout storage
            CloudStorage cs = new CloudStorage();
            ICloudStorageAccessToken token = cs.Open(UsedConfig, GeneratedToken);

            Assert.IsNotNull(token);

However, notice the "Browse to authURL in browser" piece. How do I do this programmatically? I attempted to use System.Net.WebClient but that failed.

Thanks,
Mark

Oct 24, 2011 at 7:57 AM

Hi Dirk,

In fact I did checkout the tutorial quite extensively.  Unfortunately, I don't believe it works any longer for people with newer DropBox applications (and corresponding Key/Secret keys).  Those with newer applications are required to use version 1 which is not covered in the turtorial you mention - an not yet available in a released version.

Thanks,
Mark

Oct 24, 2011 at 9:50 AM
Hi,

you are right, I checked it too and I think an update of the tutorial is needed at the weekend ;-)

BTW: Welcome to our project!

Thanks
Dirk

Sent from my iPad

On 24.10.2011, at 08:57, MarkMichaelis <notifications@codeplex.com> wrote:

From: MarkMichaelis

Hi Dirk,

In fact I did checkout the tutorial quite extensively. Unfortunately, I don't believe it works any longer for people with newer DropBox applications (and corresponding Key/Secret keys). Those with newer applications are required to use version 1 which is not covered in the turtorial you mention - an not yet available in a released version.

Thanks,
Mark

Oct 24, 2011 at 2:18 PM

Hi Dirk,

Your answer to the original question was to use the WebBrwserControl but this requires having a UI.  How do I do this without a UI - say a command line utility or a library.  

Thanks,
Mark

Oct 24, 2011 at 4:45 PM
Hi,

no during setup of your tool you need to provide an ui which generates the token.

Cheers
Dirk

Sent from my iPad

On 24.10.2011, at 15:19, MarkMichaelis <notifications@codeplex.com> wrote:

From: MarkMichaelis

Hi Dirk,

Your answer to the original question was to use the WebBrwserControl but this requires having a UI. How do I do this without a UI - say a command line utility or a library.

Thanks,
Mark

Oct 24, 2011 at 4:47 PM
Thanks!
Mark



On Mon, Oct 24, 2011 at 8:45 AM, dei79 <notifications@codeplex.com> wrote:

From: dei79

Hi,

no during setup of your tool you need to provide an ui which generates the token.

Cheers
Dirk

Sent from my iPad

On 24.10.2011, at 15:19, MarkMichaelis <notifications@codeplex.com> wrote:

From: MarkMichaelis

Hi Dirk,

Your answer to the original question was to use the WebBrwserControl but this requires having a UI. How do I do this without a UI - say a command line utility or a library.

Thanks,
Mark

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 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