Since a few days ago, when the component TMSFMXCludDrive in my android application connects with GoogleDrive I receive a warning stating: We are no longer allowing OAuth requests in embedded browsers known as "web-views."
He warns that since April 20 this form of authentication will no longer work.
How do I use the browser device for OAuth requests instead of an embedded web-view? Thank you
I updated TMS Cloud Pack for FireMonkey to the latest version (3.2.5.0), and made the changes in the project mentioned in the developers guide to enable external browser support for Google services:
- Disable the file android-support-v4.dex.jar
- Add the files android-support-v13.jar and CustomTabs.jar
(In the Android Libraries section of the Target Platforms list of a project)
The project compiles but gives the error [PAClient Error] Error: E2312 when I try to deploy.
If I revert this changes the project starts on the android device, but the "Enable external browser support" option does not work.
I have been trying for several days and I can not generate the distribution of the project.
I have also tested with a new project that has only the component TMSGdrive and gives the exact same error, in my 2 computers. Also deleted AndroidManifest.template.xml with no sucess. I checked all the paths mentioned in the error text and appear to be valid.
I do not know how to fix it. Any help will be greatly appreciated.
is it possible that the new TMSFMXCloudGDrive has a bug?
After the authentification the PersistTokens will be saved in ini file.
Before the new non embedded browser authentification it was possible to communicate with Google Drive with the saved tokens. This isnt possible anymore. After a new start of the app I have to authenticate again and again.
I also checked your CloudStorage demo. The same problem. I do connect, authenticate and get the folder list. Also after disconnect and reconnect. But if I start the app again, I have to authenticate again in the browser.
With debugging I found that LJSSLConext is NIL in FMX.TMSCloudBase (line 4202). Only after OAuth the LJSSLConext isn't NIL.
Is this normal that I have to authenticate every time?
Although with version 10.2 I could make the deploy, the application gave many runtime errors and could not connect with GDrive.
Finally I downgraded to 10.1 update 2 and is running ok.
As I described the problem occurs in you actual CloudStorageDemo! The only thing I did was to cativate the ExternalBrowser porperty, which wasn't active by default.
The problem occurs on two Android smartphones and one tablet. (The windows version works correct).
- Your PersistTokens settings for the TTMSFMXCloudGDrive control
DataSource: <empty>
Key: meine.ini
location: pINIFile
Section: TOKENS
- Which version of Delphi are you using
Delphi Berlin 10.1 Update 2
- On which platform does the issue occur
Android 4.4 and Android 6
- Does the issue occur with ExternalBrowser enabled or disabled or both
I can only use ExternalBrowser because GDrive doesn't allow me to use an embedded browser.
> I have not been able to reproduce this issue.
Please connect to Google Drive and close the app completely. Restart the app and you have to auth again.
Sorry, there isn't a problem to write the ini file. The ini file has the decrypted information of ACCESS_TOKEN, AUTH_TOKEN, REFRESH_TOKEN and so on.
The problem is still here after restart the app:
LoadTokens loads the data.
TestToken is false, because the GetJSONObject() is NIL, because the result of HttpsGet is '' (empty), because LJSSLContext is not assigned.
Thats why the app tries to RefreshAccess; The Result is also false because the result of HttpsPost() is 0 because LJSSLContext is still not assigned.
After a restart of the app the LJSSLContext is ever NIL, because only the function DoAuth calls the procedure InitializeSSLCert to initialize the LJSSLContext...
The only second possibility to initialize the variable is to call the function FMX.TMSCloudBase.Connect, but this function is protected.
That's why your CloudStorageDemo can't call the Connect() function and that's why you have to authenticate every restart of the app.
Please make a review of this issue or give us an example how we can call the Connect() function of the CloudBase unit.