Skip to content

Updating library from 1.17 to 1.20 introduce breaking change by making authentication provider mandatory #605

@andrew-vdb

Description

@andrew-vdb

This is working on 1.17

var accessToken="xxxx";
var graphClient = new GraphServiceClient(null);

 var user = await graphClient.Me.Request(new List<HeaderOption>()
            {
                   new HeaderOption("Authorization", "Bearer " + accessToken)
            }).GetAsync();

Breaking change 1 on 1.20

var graphClient = new GraphServiceClient(null); // NullException being thrown

Breaking change 2 on 1.20

var accessToken="xxxx";
var graphClient = new GraphServiceClient(new HttpClient());

 var user = await graphClient.Me.Request(new List<HeaderOption>()
            {
                   new HeaderOption("Authorization", "Bearer " + accessToken)
            }).GetAsync();// Authentication provider is required before sending a request. 

First of all, why breaking change on minor update?

Why make authentication provider required? It was good, I put the access token to the request anyway but now i get this error
Status Code: 0
Microsoft.Graph.ServiceException: Code: invalidRequest
Message: Authentication provider is required before sending a request.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions