views:

1078

answers:

7

Hi,

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...

Regards /Oscar

+1  A: 

Hi Oscar

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.

WebDude
A: 
Mufasa
The browser usually drops custom headers...
A: 

Thanks for the tip!

A problem here is that we have 30 people in our team that needs access + a lot of business people. It is not feasible for all this people to edit info in a test runner... I need to develop and deploy an application that can mimick our SSO behaviour in a number of ways.

/Oscar

A: 

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

A: 

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

stefano m
A: 

Thanks for the tip about Forms Auth. but I think that our security infrastructure/requirements are a bit more complex than just "private folders".

This is however not a thread/question about various methods of doing Authentication/Authorization in ASP.NET. It is a question of how to send custom http headers. So once again thanks for your answer. It will not however help me here...

+1  A: 

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

This Setting is found in the App-Pool Properties.

Georg