SkyDrive in Cloud Demo

Hi,

I try to connect Skydrive (or OneDrive) in the project CloudStorageDemo.

I have the following error:
HTTPS GET RESULT:{
   "error": {
      "code": "request_token_invalid", 
      "message": "The access token isn't valid."
   }
}

I create my application in account.live.com, I put a name, and generate ClientId and ClientSecret that i wrote in APPIDS.INC.
For Callback URL, I create a virtual domain, named http://localdev.rca.com/ in APiSettings, and I wrote, in TAdvSkyDrive.App.CallbackURL, http://localdev.rca.com (i put 80 in Callback Port).
Finally, I append a line in hosts file:
127.0.0.1       localdev.rca.com

Any idea of what I forgot?
Thanks

Hi,


Can you please make sure the same CallBack URL is defined in the Live application?

If the problem persists, have you tried using an empty CallBackURL for TAdvSkyDrive (as demonstrated in the Cloud Storage Demo included with the product download)?

Hi,

Yes, it's the same CallBackURL.

I try to use empty URL in the Live application.
But in CloudCustomWinLive.pas, there's a default CallBackURL.

And this is the GetAuthURL I obtain:
https://login.live.com/oauth20_authorize.srf?client_id=000000004412F1BF&response_type=code&scope=wl.signin%2Cwl.basic%2Cwl.offline_access%2Cwl.skydrive%2Cwl.skydrive_update%2Cwl.offline_access&redirect_uri=https%3A%2F%2Flogin.live.com%2Foauth20_desktop.srf

When I put this URL in google Chrome, a blank page appear.

If i remove redirect_uri (to obtain the empty uri as in Live application), it's doesn't work too.

Any idea?
thanks

Please do NOT use an empty callback URL, it won't work with an empty callback URL.
Please specify in your Live app settings a valid callback URL.
When a problem persists, please enable logging and send us the generated log file so we can inspect what exactly happens.

ok, i found my error: i forget to put 'Yes', in ApiSettings, for desktop application.


now, it's ok, with empty callback URL.

PS: the component TAdvOneDrive doesn't work: it doesn't use TAdvSkyDrive.DoAuth. But it's ok with TAdvSkyDrive.

Thanks a lot and i apologize for the inconvenience.

I have retested TAdvOneDrive here but can't see an issue with DoAuth. It is calling the inherited method DoAuth from TAdvSkyDrive.

i used TAdvOneDrive component, put clientId and secretKey, and call AdvOneDrive1.DoAuth.

i put a breakpoint in CloudWinLive.pas,  procedure TAdvSkyDrive.DoAuth, line inherited;
but it's doesn't stop.

Delphi XE5, TMSCloudPack Release 2.7.1.0

I can't see this problem here.  It correctly stops in TAdvSkyDrive.DoAuth and if you look at the code, there shouldn't be any reasons not to stop there.
Are you sure you have a clean setup, i.e. only one & correct version of the TMS Cloud Pack files in your library path

Ok, we found the problem.


Why is there 2 declarations of TAdvOneDrive? one in CloudWinLive.pas and the other in CloudCustomWinLive.pas?
In the project Demo, the first declaration in uses is CloudWinLive. So the inherited is not the good one.
If you remove the uses, and add TAdvOneDrive component, 2 uses are added, but in good order (Custom first).

You're correct. The one in CloudCustomWinLive should be removed. We removed this. Next update will have this fixed.

ok, thanks for your answer