WebMatrix WebSecurity PasswordSalt

后端 未结 2 2018
无人共我
无人共我 2020-12-06 09:12

I am using WebMatrix and have built a website based on the \"StarterSite\". In this starter site you get a nice basic layout - including registration, login, forgot password

2条回答
  •  旧巷少年郎
    2020-12-06 10:07

    As of the RTM release of WebMatrix/ASP.NET Web Pages, the salt feature/column is unused.

    If you open up the Web Pages source, you'll see the db classes littered with references like

    INSERT INTO [" + MembershipTableName + "] (UserId, [Password], PasswordSalt
    

    ...

    VALUES (uid, hashedPassword,String.Empty /* salt column is unused */
    

    shortened for emphasis

    There are definately ways to override and implement this behavior, first being:

    • override System.WebData.SimpleMembershipProvider.CreateAccount()

    or

    • extend with System.WebData.SimpleMembershipProvider.CreateAccountWithPasswordSalt()

    not going to go into detail there though unless you request, as your usage of WebMatrix and a template suggests you probably don't wanna mess with rewriting a ton of your own C#/ASP code for this project.

提交回复
热议问题