A
A
AbnormalUnit2012-03-04 17:22:32
C++ / C#
AbnormalUnit, 2012-03-04 17:22:32

Simple authorization on ASP.NET MVC3?

Hello.
It would not be desirable to use the massive built-in authorization, for only one user.
What other ways are there, simpler?
Is there a good manual for Forms Athentication somewhere? And then I did not understand something right off the bat ...

Answer the question

In order to leave comments, you need to log in

3 answer(s)
E
eforce, 2012-03-05
@eforce

What other ways are there, simpler?
Steven Sanderson - Pro ASP.NET MVC 2
Steven Sanderson - Pro ASP.NET MVC 3
In the Securing the Administration Features section. There are only a few pages of description, the code can be copied. The meaning is something like this:

<authentication mode="Forms">
 <forms loginUrl="~/Account/LogOn" timeout="2880">
  <credentials passwordFormat="Clear">
   <user name="admin" password="secret" />
  </credentials>
 </forms>
</authentication>
* This source code was highlighted with Source Code Highlighter.

The login and password are stored in Web.config (of course, the password must be stored as a hash, for example, SHA1). Then you can use [Authorize] and everything will work, for several users - I think this is optimal, no databases.

I
Irrra, 2012-03-04
@Irrra

here on Habré a person made his own authorization mechanism in MVC - habrahabr.ru/blogs/aspnet_mvc/127755/
Maybe it will suit you.

E
ekulakov, 2012-03-04
@ekulakov

Use Windows Authentication. Easier nowhere.
More details here: http://www.asp.net/mvc/tutorials/older-versions/security/authenticating-users-with-windows-authentication-cs .
There is also a link to the Forms Authentication docs on the right.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question