-2

Looking for best way to implement basic authentication where user needs to enter username and password and I can control the database of users.

This is for c# and MCV application.

Just looking for a pointer or sample for best way to implement this in MVC.

tereško
  • 58,060
  • 25
  • 98
  • 150
StevieB
  • 6,263
  • 38
  • 108
  • 193

3 Answers3

0

Assuming you're using IIS, look at HTTP Basic authentication configuration for that kind of requirment.

Using that authentication, the user automatically will be prompted to enter user & password.

Take on account that this mechanism is considered as very week protection and you should integrate SSL (HTTPS) with that.

MSDN:

However, the disadvantage of Basic authentication is that it transmits unencrypted base64-encoded passwords across the network. You should use Basic authentication only when you know that the connection between the client and the server is secure. The connection should be established either over a dedicated line or by using Secure Sockets Layer (SSL) encryption and Transport Layer Security (TLS). For example, to use Basic authentication with Web Distributed Authoring and Versioning (WebDAV), you should configure SSL encryption.

Yair Nevet
  • 12,725
  • 14
  • 66
  • 108
0

This question is pretty broad. Use the basic Visual Studio authentication template:

enter image description here

Then, read about it more in MSDN.

Ofiris
  • 6,047
  • 6
  • 35
  • 58
0

You could override the default membership and role providers if you wanted something simple. Take a look here for a nice tutorial on how to achieve this.

Marc
  • 924
  • 1
  • 8
  • 18