.Net Authentication Template

I plan to create a component that can verify user credentials (username and password) and, if valid, returns the associated profiles. I do not want to use providers that already exist in the .Net infrastructure (I am trying to implement my development skills ). Is there any sample that I can use? Or standards?

+3
source share
2 answers

Membership providers are really enjoyable, and you can definitely use your developer skills, even if you use them. But you would develop something other than the user service auth / profile !.

If you really want to collapse it yourself, you will need a store for a username and password hash. When users register, they need to enter a password and then use it. Store your username and password in any store you choose. Then, when the user logs in, you get the hash that they provide and check it against the stored hash.

For the simplest cases, you can simply use an XML file with a list of elements, one element for each user, and you can use XmlSerialization to insert and save it.

<UserDB>
  <user>
    <name>Obsidian</name>
    <pwhash>8731876r4hndmhduihd</pwhash>
    <dateadded>2009-03-25-18:34:44</dateadded>
 </user>
</UserDB>

But you can also use the database, or AD / AM, in another store.

+1
source

The providers that supply .Net are all unloaded from System.Web.Security.MembershipProvider.

, , - , . , , , .

+2

Source: https://habr.com/ru/post/1705376/


All Articles