4

I need to create and add custom headers to an ASP.NET 2.0 application. The case is simulation of an SSO-login in our dev/test environment.

When I try to add headers I run into the "Not supported on this platform." error. BigJim has a nice post on the subject here: http://bigjimindc.blogspot.com/2007/07/ms-kb928365-aspnet-requestheadersadd.html

The root of my problem lies in the fact that I need to simulate various persons logging into my application. Not just adding static data in a HttpModule. I need to take values from a couple of TextBoxes and transfer information from these into custom headers and then re-direct the user. The HttpModule stuff happens to early in the pipeline...

Does anyone now if there exsist a simple redirect/proxy solution that one could use in a dev environment? Or have simple/beautiful way of doing it in code?

5 Answers 5

1

One method i have used before, though a long winded approach, is NUnitASP.

This is based on the NUnit framework but intended for ASP.NET UI Testing.

It basically starts a browser in memory, and is able to manipulate the content exactly like a user would. Using this you could view your page, enter data into textboxes and submit pages.

Hopefully that can help you do the testing you require. I've used it to test load, and spider through sites of mine to gather data.

Sign up to request clarification or add additional context in comments.

Comments

1

If you use IIS 7 you can set the Pipeline Mode to integrated

This Setting is found in the App-Pool Properties.

Comments

0

I could be wrong, but doesn't the Response.AddHeader() method still work?

Although, I agree with Oscar that a formal testing solution like NUnitASP is a good idea. Although, NUnitASP is a little dated. I still use it for some of my projects just because it still does work; it just isn't as refined or as simple as WaTiN or similar projects.

Comments

0

The browser drops the header if you do a Response.AddHeader()... The header must be added to the orginal Request...

Comments

0

why don't use ASP.NET forms authentication model?

you define your "private folders". if you attempt to acces to a private folder without login, you automatically are redirected to a your custom login page.

here's a couple of link: http://support.microsoft.com/kb/301240

http://www.asp.net/learn/security/tutorial-02-cs.aspx

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.