I am trying to access office 365 users using Graph SDK provided by Microsoft in NuGet my code is :
var cca = ConfidentialClientApplicationBuilder
.Create("ClientId")
.WithClientSecret("ClientSecret")
.WithTenantId("TenantId")
.Build();
List<string> scopess = new List<string>();
scopes.Add("https://graph.microsoft.com/.default");
scopes.Add("Calendars.Read");
// i tried each scope alone and same result
var authenticationProvider = new AuthorizationCodeProvider(cca, scopes.ToArray());
GraphServiceClient graphClient = new GraphServiceClient(authenticationProvider);
var x = await graphClient.Users.Request().GetAsync();
on the last line i am getting the error
Authentication challenge is required
my Azure Active Directory app registration settings are :
probably i am doing something wrong but not sure what! I am using the Microsoft Docs as a reference