4

I've got a hybrid web application. Some stuff is done the mvc way, and some stuff is done via javascript ajax postbacks. I'm authenticating against AAD B2C in the mvc app. But the clientside javascript needs to include a bearer token header to hit the server directly. The question is - how do I get the token so I can pass it back to the UI (in the view model)?.

Many thanks

Nick

FeeFiFoFum
  • 1,719
  • 1
  • 11
  • 18
  • Are you using Azure AD B2C? Doesn't sound like it. If so, can you remove the Azure-AD-B2C tag? Thanks :) – spottedmahn Nov 21 '17 at 14:00
  • Sorry, yes I'm using b2c. I've updated my question. I figure the answer will be the same for AAd and AAD B2C - hence my tagging for both. – FeeFiFoFum Nov 21 '17 at 22:35
  • Cool. And nope, they're different (similar but different from what I've learned so far). – spottedmahn Nov 22 '17 at 11:23
  • The problem is w/ the JS postbacks, right? FYI, they are not ajax calls, [they are form submits](http://aspalliance.com/895_Understanding_the_JavaScript___doPostBack_Function.2). – spottedmahn Nov 22 '17 at 11:33

1 Answers1

0

Since __doPostBack is a form submit, it is not possible to add an HTTP header.

spottedmahn
  • 14,823
  • 13
  • 108
  • 178