Skip to content

CAE error after version 5.56.1 #3056

@curcas

Description

@curcas

Describe the bug

Previous to version 5.56.1 we were able to list the drives of a sharepoint site.
After the mentioned version the request fails with the following error message:

Microsoft.Graph.Models.ODataErrors.ODataError: 'Continuous access evaluation resulted in challenge with result: InteractionRequired and code: LocationConditionEvaluationSatisfied'

The request is done with an app registration with client id and client secret

var options = new ClientSecretCredentialOptions();
var clientSecretCredential = new ClientSecretCredential("tenant-id", "client-id", "secret", options);

var httpClient = GraphClientFactory.Create();
var client = new GraphServiceClient(httpClient, clientSecretCredential, scopes);

await client
    .Sites["site-id"]
    .Drives
    .GetAsync();

Getting the token on its own and then accessing the drives with the token works as expected.

var scopes = new[] { "https://graph.microsoft.com/.default" };
var clientSecretCredential = new ClientSecretCredential("tenant-id", "client-id", "secret");
var tokenRequestContext = new TokenRequestContext(scopes);

var token = await clientSecretCredential.GetTokenAsync(tokenRequestContext);

var httpClient = new HttpClient();
httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Token);

var response = await httpClient.GetAsync("https://graph.microsoft.com/v1.0/sites/site-id/drives");
var body = await response.Content.ReadAsStringAsync();

Expected behavior

Client should return the drives without error.

How to reproduce

var options = new ClientSecretCredentialOptions();
var clientSecretCredential = new ClientSecretCredential("tenant-id", "client-id", "secret", options);

var httpClient = GraphClientFactory.Create();
var client = new GraphServiceClient(httpClient, clientSecretCredential, scopes);

await client
    .Sites["site-id"]
    .Drives
    .GetAsync();

SDK Version

5.56.1

Latest version known to work for scenario above?

5.56.0

Known Workarounds

No response

Debug output

Configuration

  • OS: Windows 11 Enterprise
  • Architecture: x64
  • Happens also on MacOS

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    status:waiting-for-triageAn issue that is yet to be reviewed or assignedtype:bugA broken experience

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions