Can I set the serverVariables variable in .NET.

Can I assign a ServerVariable value using code? instead of doing it through IIS?

something simple?

Request.ServerVariables ("LOGON_USER") = "test"

I also found the following on another forum:

Request.ServerVaria bles.Add (name, value)

but I still get the same error: "Awaited claim"

some background:

What I'm trying to do is pass a variable ("LOGON_USER") from one application to another (in a different domain) to somehow resolve one character. Now I am passing hidden variables to the new server and then I want to assign them to the corresponding server variables. Do I then need to edit the response or request? am I on this?

+3


source to share


2 answers


SSO is usually not done this way. Typically, you should authenticate the user to the first system, create a secure token, and then pass the token along with some identifying information to the second system. The second system would check the token and additional data, and if successful, authenticates the user to the second system (usually by creating an auth cookie).



This link gives you an overview of one approach, but you can Google for other methods: http://msdn.microsoft.com/en-us/library/ms972971.aspx

+2


source


You can set server-side variables (although you usually want to change the response, not the request), and the most likely place to do this would be in a custom HttpModule. You can find more details here:

http://learn.iis.net/page.aspx/686/setting-http-request-headers-and-iis-server-variables/



and

http://forums.asp.net/t/1125149.aspx

0


source







All Articles