views:

53

answers:

1

Hellu,

I want to put a password protection on my entire web application for development and testing purposes. I would like some simple way to do this (global asax, webconfig etc), which means I don't have to change very much in the rest of my application. The password and username can be stored in the code/webconfig or whatever.

Since I'm not hosting it by myself, I have limited access to the server (and can't modify the IIS in any way).

Anyone knows a good, simple, quick, awesome way to achieve this (other than placing the whole thing in a "secret" folder)?

+2  A: 

Simplest thing to do is:

  1. Use Forms Authentication...
  2. ...with this simple, XML membership provider
  3. Add [Authorize] to a parent controller class and use it for all controllers in your app.
Craig Stuntz
I liked the [Authorize]-method, I'll try that one.
Undeph
You must do all three steps.
Craig Stuntz