I've upgraded my FMX Cloudpack with the last release and since, OneDrive access don't work.
First, I see the OAuth form displayed. I input mail and password ok.
But when I want to access, I see the OAuth form redisplayed with only "CLOSE" button and after 2 seconds, the form is closed and nothing append (see screen capture)
Same code with Dropbox and GoogleDrive and it works...
it happens when I try to disconnect by erasing the tokens
The following connection does not work. The OAuth screen is only displayed with the "Close" button as shown in the screenshot and closes after 2 or 3 seconds
To deconnect I wrote this :
CloudStorage.ClearTokens;
CloudStorage.Disconnect;
where CloudStorage is a TMSFMXCloudSkyDrive component.
This most likely happens because you are still logged in for OneDrive in the browser. Therefore tokens are automatically provided without the need of logging in first. The solution is to force a log out with the Logout call.
I have now been able to reproduce the issue. The issue is caused by an incompatibility between the internal browser and the API service. To avoid this the ExternalBrowser property has been implemented for the TTMSFMXOneDrive component (this property is already available for some other services like DropBox and GDrive). This way the authentication occurs in an external browser window and you can manualy log out by starting the browser seperately from the application. The update will be available with the next release of TMS FMX Cloud Pack.
Bart Holvoet2020-01-29 13:34:04
Please note that Logout will have no effect when ExternalBrowser is set to True. You would have to logout from your Microsoft account from the browser window.
Please note that it's a security limitation to programmatically logout from an external browser window. Different services use different behaviour and different techniques to persist data in their pages, unfortunately we have no control over this.