I'd like to call the CloudPC rest API using a C# client. The C# client is in the beta nuget package Microsoft.Graph.Beta. Here is a sample client that illustrates how to authenticate using the the non-beta client.
// Build a client application.
IPublicClientApplication publicClientApplication = PublicClientApplicationBuilder
.Create("INSERT-CLIENT-APP-ID")
.Build();
// Create an authentication provider by passing in a client application and graph scopes.
DeviceCodeProvider authProvider = new DeviceCodeProvider(publicClientApplication, graphScopes);
// Create a new instance of GraphServiceClient with the authentication provider.
GraphServiceClient graphClient = new GraphServiceClient(authProvider);
When I try to use that sample client with the non-beta nuget I get discover I cannot resolve DeviceCodeProvider
. So what I can I use instead of DeviceCodeProvider
?
Michael Mainer tells me I can use DeviceCodeCredential which does resolve. Still the sample is not yet functional. So now I'm trying to adapt this sample Michael sent me.
Michael also sent me a pointer to LinqPad samples which are useful for poking at the API.
I have a bunch of queries setup MIchaelMainer/graph-test-harness: This repository contains samples for a Microsoft Graph test harness to quickly and easily test SDKs (github.com) to help try out the libraries. I have an option for DeviceCodeCredential.