OneDrive / onedrive-sdk-dotnet-msa-auth-adapter

Other
25 stars 22 forks source link

I keep getting invalid request #16

Closed ghost closed 8 years ago

ghost commented 8 years ago

The following code produces an "Invalid Request" after authentication to onedrive. What could be the problem?

Dim clientid = "blabla" Dim clientsecret = "blabla" Dim scopes() As String = {"User.Read", "Files.ReadWrite", "offline_access"}

Dim auth As New Microsoft.OneDrive.Sdk.Authentication.MsaAuthenticationProvider(clientid, clientsecret, "https://localhost", scopes, New CredentialCache(), New CredentialVault(clientId))

await auth.RestoreMostRecentFromCacheOrAuthenticateUserAsync() client = New OneDriveClient(auth)

Dim items = await client.Drive.items.Request().GetAsync() For Each I In items Debug.WriteLine(I.Name) Next

ghost commented 8 years ago

I see what is the problem ...

Dim items = await client.Drive.items.Request().GetAsync() needs to change to Dim items = Await client.Drive.Root.Children.Request.GetAsync()