Dropbox API SDK for Xojo - Open Source

We still struggle with the 2nd error, showing up after we seemingly have authorized. Now, when clicking on the button “My account info”, then we get the error message “error, No auth method found”.

Any hints on how to solve this?

It fails in the function API_Call_AccountInfo, and currently I don’t know what makes it fail. Has anyone overcome this issue?

I have not and I have this in one production app. I am beginning to wonder if this is a demo implementation issue vs functionality issue. Oliver I will try to see how to recreate this.

Thanks!

The error message “error: no auth method found” occurs when you authenticate via o-auth but do not complete the Linkedin user account authorization. In this demo code I don’t have any user control around the fact that you can close that htmlviewer window at anytime thus bypassing the user account authorization in which will generate the “error: no auth method found”. I also don’t have the timing of the “progress wheel” in the demo app is just on a timer so if there is a slower internet connection the wheel will complete but you may still have to wait. I didn’t have the time to get too fancy for the demo app :slight_smile:

What may be happening is that you are not waiting long enough for the HTMLViewer to return the Linkedin User Account Auth Page. I tested the demo app and it works, but ironically I am at a location where the internet is not the fastest so I had to wait past the progress wheel for the page to pop up.

I have created a new app in Dropbox. After a click on the “Authorize” button this window is opened:

I click on “Zulassen” and this is displayed in the window:

Debug stop with this error:

After resume and a click on “My Account Info”
Debug error:
// SET OAUTH TOKEN BEARER HEADER
Dim theAccessToken as String = DropboxOAUTHSocket.DropboxTokenResultsDictionary.Value(“access_token”)
After resume, I get
error: No auth method found.

Horst I am not sure what that first page is :slight_smile: I removed the progress wheel since my good intentions for it didn’t work out as it caused too much confusion since most probably thought it was tied to the actual wait duration from dropbox (it wasn’t).

Your debug stop error came from my feeble attempt to try and make my “demo” app spiffy which was a mistake and I removed it from the demo project :slight_smile: I reran the same project minus the progress wheel and it works with my dropbox app as expected.

I can’t tell from your screen shots but this should be the flow of events after you fill out your dropbox client-id/secret and press authorize.

  1. HTML Viewer pops up and loads the DROPBOX Account Authorization for you to put in your dropbox username and password (normal user dropbox account).

  2. After the successful authentication the oauth process completes and the HTMLViewer says “Dropbox link with … success”

  3. Close the HTML Viewer (sucks that dropbox makes us integrate this way for version 1.0 (I am hoping 2.0 changes this)

  4. Press on the buttons to do dropbox stuff on the demo…

HTH…

WELL I May have found my issue on this situation. I am forcing the English Locale which I am sure is not good for you guys that need other locales… :slight_smile:

I will add the selection of Locale on the demo app so it passes based on your selection.

EDIT: I just committed the support for selecting and passing the locale.

The Dropbox Account Authorization is just blank for me, nothing ever appears…any ideas?

On Mac OS X, the same error. On Window7 and Windows10 the Dropbox Account Authorization is just blank

If you guys could help troubleshoot it that would be great. It works for me with my app every time no issue so I can’t seem to recreate it. Could either one of you guys do a screen flow capture or video for me to see this fail in real time?

Also I only developed this testing OS X.

Thanks!

[quote=185289:@Mike Cotrone]<…>Could either one of you guys do a screen flow capture or video for me to see this fail in real time?
<…>![/quote]
http://osswald.com/xojo/issues/dropbox/index.html

Oliver thank you so much for the screen flow video. I will start a new app since mine is working so I may recreate this experience. Thank you again!

Apparently there is a problem with HTMLViewer1 as well as with TitleChanged event on Windows.

I have made some changes, but I have only managed to get the code at the following link to work once:

https://www.amazon.com/clouddrive/share/0VSVwJVmmSJ8xfXLZct-khuSgOirF7tgkzVI9K29RjY?ref_=cd_share_link_copy

[quote=185501:@Christopher Wade]Apparently there is a problem with HTMLViewer1 as well as with TitleChanged event on Windows.

I have made some changes, but I have only managed to get the code at the following link to work once:

https://www.amazon.com/clouddrive/share/0VSVwJVmmSJ8xfXLZct-khuSgOirF7tgkzVI9K29RjY?ref_=cd_share_link_copy[/quote]

Christopher I did not test this for Windows only Mac.

We’ve had problems with the HTMLViewer. Did you use native or Webkit as renderer?
You might experiment with that maybe?
I’m currently in the process of trying to figure out why our internal implementation of the same (but for Google) seems to crash on certain computers (customers and some computers in our support department), but of course not on mine (I have tried on 4 test machines and it all works fine). The whole app just quits without error upon opening the screen with the HTML viewer (and we’re using webkit on that screen). Trying to figure out what the difference is in between the machines now.

Thanks Dirk!! I appreciate the advise. I still find this whole thing “interesting” to say the least since this code base is in two of my MAS apps working perfectly. I am sure it is tied into the dropbox core api app.

If ANYONE has any time to contribute to this project I would SURELY appreciate it. I basically at the moment have 0 time available for open source work unfortunately. Feel free to fork/clone if you have time.

Thank you again
Mike

Hello,
Here the changes I made :

Create a new property :

Private parsenotok As Boolean = False

Modify ParseCode int the DropBoxAuthorizeWindow :

[code]Private Sub ParseCode(PageContent as String)
Try
Self.ChartOpenCircle1.Visible = False
Self.ChartOpenCircle1.Enabled = False
Catch
End Try
// PARSE CODE
Dim Parse_AccessCode_RegEx as RegEx
Dim Parse_AccessCode_RegExMatch as RegExMatch
Dim Parse_AccessCode_HitText as String
Parse_AccessCode_RegEx = New RegEx
Parse_AccessCode_RegEx.Options.CaseSensitive = False
Parse_AccessCode_RegEx.Options.Greedy = True
Parse_AccessCode_RegEx.Options.StringBeginIsLineBegin = True
Parse_AccessCode_RegEx.Options.StringEndIsLineEnd = True
Parse_AccessCode_RegEx.Options.MatchEmpty = True
Parse_AccessCode_RegEx.Options.TreatTargetAsOneLine = False
Parse_AccessCode_RegEx.SearchPattern = “(?<=\?code=).+”

Parse_AccessCode_RegExMatch = Parse_AccessCode_RegEx.Search(PageContent)

//Changed by Valdemar
if Parse_AccessCode_RegExMatch <> nil and not parsenotok then
Parse_AccessCode_HitText = Trim(Parse_AccessCode_RegExMatch.SubExpressionString(0))
Common_Module.DropboxOAUTHSocket.Dropbox_Access_Code = Parse_AccessCode_HitText
parsenotok = True
HTMLViewer1.Enabled = True
HTMLViewer1.Visible = True
else
HTMLViewer1.ExecuteJavaScript(“location.reload();”)
end if

End Sub
[/code]

And it works now

Enjoy :slight_smile:

First I have made the last changes. Then I got to dropbox and create an “Access Token” for my app. In debug mode the app connects to dropbox with success. I received an email from dropbox:

The new app “AcanaLCM” is linked to your dropbox. Excellent!

After I habe clicked on button “My Account Info” the debug stops at:
Dropbox_API_Calls.Construction
Exception self theAccessToken => Value: KeyNotFoundexception

After resume the app, I got "error: No auth method found

I have tested this app on Mac OS X 10.10.3 with Xojo 2015R2.1

It appears dropbox has added a new version of this API. I have recreated this and will begin working on it.

[quote=186059:@Valdemar De SOUSA]Hello,
Here the changes I made :

Create a new property :

Private parsenotok As Boolean = False

Modify ParseCode int the DropBoxAuthorizeWindow :

[code]Private Sub ParseCode(PageContent as String)
Try
Self.ChartOpenCircle1.Visible = False
Self.ChartOpenCircle1.Enabled = False
Catch
End Try
// PARSE CODE
Dim Parse_AccessCode_RegEx as RegEx
Dim Parse_AccessCode_RegExMatch as RegExMatch
Dim Parse_AccessCode_HitText as String
Parse_AccessCode_RegEx = New RegEx
Parse_AccessCode_RegEx.Options.CaseSensitive = False
Parse_AccessCode_RegEx.Options.Greedy = True
Parse_AccessCode_RegEx.Options.StringBeginIsLineBegin = True
Parse_AccessCode_RegEx.Options.StringEndIsLineEnd = True
Parse_AccessCode_RegEx.Options.MatchEmpty = True
Parse_AccessCode_RegEx.Options.TreatTargetAsOneLine = False
Parse_AccessCode_RegEx.SearchPattern = “(?<=\?code=).+”

Parse_AccessCode_RegExMatch = Parse_AccessCode_RegEx.Search(PageContent)

//Changed by Valdemar
if Parse_AccessCode_RegExMatch <> nil and not parsenotok then
Parse_AccessCode_HitText = Trim(Parse_AccessCode_RegExMatch.SubExpressionString(0))
Common_Module.DropboxOAUTHSocket.Dropbox_Access_Code = Parse_AccessCode_HitText
parsenotok = True
HTMLViewer1.Enabled = True
HTMLViewer1.Visible = True
else
HTMLViewer1.ExecuteJavaScript(“location.reload();”)
end if

End Sub
[/code]

And it works now

Enjoy :)[/quote]

Valdemar,

Thank you again for this contribution! This also fixed my version and I will add this to the code base.

Thanks!