0

I am trying to figure out how to add the OAuth Token to a Breeze-Sharp request. I am using Microsoft WebAPI and I want to use the OAuth token from OWIN to authorize all my query requests. I am not seeing where or how to change the request headers. I see that you can add parameters to a query using WithParameter but I am not seeing where I can change the header. I am looking for something like this:

var query = new EntityQuery<TodoItem>().[AddHeader("Authorization","Bearer wkjksdjf...."];
rewritten
  • 16,280
  • 2
  • 47
  • 50
BryanP
  • 1
  • 1

1 Answers1

2

You can add the authorization header to HttpClient used by EntityManager.

eq.

this.entityManager.DataService.HttpClient.DefaultRequestHeaders.Authorization = 
new AuthenticationHeaderValue(AuthenticationSetup.Bearer, authenticationHeader);
mrBob
  • 385
  • 6
  • 22