Closed PhilPJL closed 4 years ago
Thanks for taking time to open this issue.
The Auth library has a WithUserAccount(GraphUserAccount)
extension method that you can call on a request like this and set the users UPN to GraphUserAccount.Email
property:
var clientApplication = PublicClientApplicationBuilder
.Create("<guid>")
.WithTenantId("<guid>")
.Build();
var authProvider = new IntegratedWindowsAuthenticationProvider(clientApplication);
GraphServiceClient graphClient = new GraphServiceClient(authProvider);
var me = await graphClient.Me.Request()
.WithUserAccount(new GraphUserAccount { Email = "UPN" }) // username (UPN)
.GetAsync();
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.
This code
works on .NET Framework, but fails on .NET Core with a PlatformNotSupportedException with message:
If I was using this directly:
var result = await clientApplication.AcquireTokenByIntegratedWindowsAuth(scopes).ExecuteAsync();
I could add WithUsername("") to ge:var result = await clientApplication.AcquireTokenByIntegratedWindowsAuth(scopes).WithUsername("<username>").ExecuteAsync();
What's the solution when using the Auth library?