iOS Question How to do Dropbox Authentication now that WebView is not allowed?

Turbo3

Active Member
Licensed User
Longtime User
My B4i app that used Webview to do Dropbox authentication has stopped working now that that method is considered a security risk by Dropbox.

Can someone share their B4i Dropbox authentication code that does not use WebView? Thanks.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0

Turbo3

Active Member
Licensed User
Longtime User
Thanks Erel.

If I understand the high level flow, the "App.OpenURL(url)" line will open the Dropbox authentication web page I point it to and the "Application_OpenURL(url)" routine will be called with the resulting access token (or not if it fails) in the returned url.
 
Upvote 0

martin24

Member
Licensed User
If I understand the high level flow, the "App.OpenURL(url)" line will open the Dropbox authentication web page

You should use the SafariController instead of "App.OpenURL(url)".

My app was rejected with "App.OpenURL(url)" and I had to switch to SafariController to link with Dropbox.
 
Upvote 0

Turbo3

Active Member
Licensed User
Longtime User
Here is the line of code that opens the web page in Safari which works fine.
B4X:
Main.App.OpenURL("https://www.dropbox.com/oauth2/authorize?client_id="&Main.key&"&response_type=token&redirect_uri=http://127.0.0.1/")
The Dropbox authorization page opens and I can login and allow my app access but at that point Safari gives the error "Safari cannot open the page because it could not connect to the server." with 127.0.0.1 being the page it is trying to open.

How do I get 127.0.0.1 connected to my app so App.OpenURL gets called?

What should #UrlScheme be set to?
 
Upvote 0

Turbo3

Active Member
Licensed User
Longtime User
I tried adding this code to tell the system to send the response to my app but it did not help.
B4X:
#UrlScheme: 127.0.0.1
 
Upvote 0

Turbo3

Active Member
Licensed User
Longtime User
You should use the SafariController instead of "App.OpenURL(url)".

My app was rejected with "App.OpenURL(url)" and I had to switch to SafariController to link with Dropbox.
This was not the case for me. I just released my updated code using "App.OpenUrL(url)" with no problems. In fact from upload to iTunes to ready for sale was under 10 minutes including review. The fastest I have ever seen.
 
Upvote 0
Top