0

I configured TLS mutual configuration for Azure app as describred here using asp.net framework 4.7.2, but the problem that in global.asax application_start my HttpContext is not available i tried both : the solution in link :

NameValueCollection headers = base.Request.Headers;

and the static Httpcontext

HttpContext.Current.Request.Headers

both returns that HttpContext is not available. how can i call HttpContext on global.asax application_start or is there a workaround to do ? my application is hosted on azure.

ZIADIA Oussama
  • 151
  • 2
  • 13
  • HttpContext holds information about the current HTTP request. It will only be available when receiving a request. You will have to authenticate every request individually. – HashedPassword Jan 29 '20 at 11:00
  • should i allow all paths in the incomming requests and after that i authenticate every request alone , like adding a custom authorization attribute that validate cerfication ? – ZIADIA Oussama Jan 29 '20 at 11:09
  • Yes. There is a guide [here](https://learn.microsoft.com/en-us/aspnet/web-api/overview/security/working-with-ssl-in-web-api) that shows you what that attribute may look like. – HashedPassword Jan 29 '20 at 11:18

0 Answers0