I am working on ASP.NET MVC 2 application. the website runs under SiteMinder (3rd party agent开发者_如何学Go) for authentication. The Siteminder injects custom header to the incoming HTTP request. But when I try to read the custom header, I donot get the value.
System.Web.HttpContext.Current.Request.ServerVariables["CustomKey"];
Looks like these custom headers are getting stripped by MVC. I hav eensured that the headers are for sure getting injected by SiteMinder.
Am I doing anything wrong while reading as shown above?
You're looking for HttpRequest.Headers
, not ServerVariables
which represent variables served by IIS to the application:
System.Web.HttpContext.Current.Request.Headers["CustomKey"];
You you tried using Fiddler Http Proxy agent to verify that custom headers is injected by siteminder in the response header.??
精彩评论