Problems DoAuth DropBox

Hi


I want to use more than 1 Dropbox Account in my Application. After Authorizing an Account, i cannot create a new Account with DoAuth. I got every time the Message in the Webbrowser to Allow my Application to use the previous created account.

Furthermore i saw, that in the Destructor of CloudDropbox that you did not free the HttpServer. So the Port is already blocked, when i free the Component

The DropBox component is the owner of the HttpServer so, the HttpServer is automatically destroyed when its owner is destroyed. When you create a new DropBox instance, you can have this instance connect again to another DropBox account.

Sorry, but this did not work. If i Destroy the Component during runtime, recreate a new one and try to connect, i got every time the error, that the port is already used. This happens, because the HttpServer will not be closed gracefully.

Hi,


Have you tried using the AdvDropBox.LogOut call before starting authentication?
This should enable you to login with a different DropBox account or create a new DropBox account.

Yes. Before we destroy the Component, we LogOut.

Performing a Logout should enable you to login/authenticate with different accounts while using a single TAdvDropBox component.

Or do you also want to use different DropBox app configurations (with different API Key & Secret)?

No. Our Customer want to use different DropBox Accounts with the Same Appkey. The First Authentication works well. But, when i logout and than try to login, i got the Message that the Address is already in use, when i destroy the component after logout. When i only Logout and try to Authenicate i got the Message in the Webbrowser, that the "Application would like to access Files or Folders in your Dropbox".

The Same happens, when i copy the Url from the HttpServer and Paste it in the IE. Here it looks like, that Dropbox cashes the Ip Address and want to connect to the same Account.

I have retested this here and the LogOut call is working as expected.

Can you please make sure the LogOut is called correctly in your application?

I added one line of code ("AdvDropBox1.Logout;") to our CloudStorageDemo application to make this work:

Example:
procedure TForm4.ConnectBtnClick(Sender: TObject);
var
  acc: boolean;
begin

  AdvDropBox1.Logout;

  Advdropbox1.App.Key := DropBoxAppKey;
  Advdropbox1.App.Secret := DropBoxAppSecret;

...

Hi


Thank you for your advice. You are right. I called the Logout Method of my component which uses the AdvDropbox, GDrive... and the Logout Method of Dropbox was not called. Sorry. After correction it works now.

Only one point did not work, When i authenticate a Dropbox Account, Logout and try to Authenticate a GDrive Account, i got the Error "Address already in use". I tried to destroy the Dropbox Component before i authenticate to GDrive with the Same Result.

I tested than with the following Code in Dropbox:

destructor TAdvDropBox.Destroy;
begin
  // CHANGED: WIN568
  if not Assigned(Owner) and Assigned(FHTTPServer) then
  begin
    FHttpServer.Active := false;
    FHttpServer.Free;
    FHttpServer := nil;
  end;
  // CHANGED: WIN568

  inherited;
end;

and this works. The problem here is, that after Authentication the HttpServer is still active. Even after Destruction of the Component the Port was blocked.





Thanks for your feedback. We'll revise this and will try to improve this at core level so all cloud components benefit from this.