Вопрос

is it possible to assign a value to a ServerVariable("Something") using the code? instead of doing it via the IIS?

something as simple as this?

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

i also found the following at another forum:

Request.ServerVaria bles.Add(name, value)

but i keep getting the same error on both: "Declaration Expected"

some background:

i am trying to do is pass in the ("LOGON_USER") variable from one applicaton to another (on a different domain), to somehow allow for single sign on. I now pass hidden variables to the new server and then want to assign them to proper servervariables. would I then need to edit response or request? am i waaay off on this?

Это было полезно?

Решение

Single sign-on is not usually implemented in this manner. Typically you would authenticate the user in the first system, create a secure token, then pass the token along with some identifying information to the second system. The second system would validate the token and the additional data, and if successful, authenticate the user in the second system (usually by creating an auth cookie).

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

Другие советы

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

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

and

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

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top