Scott on Writing

Musings on technical writing...

Final Three Security Tutorials Published

As noted in previous blog entries, I've been working on some tutorials for the www.asp.net site on the topics of forms authentication, authorization, membership, and roles. The first set of tutorials covered security basics and examined forms authentication in detail; the second set looked at the Membership system and the SqlMembershipProvider. The third set of tutorials examined the Roles framework and the SqlRoleProvider. The final slate of tutorials includes three on implementing common administrative tasks.

  • Building an Interface to Select One User Account from Many [VB | C#] - when we needed to select a user account in previous tutorials we used a drop-down list. While a drop-down list is sufficient if there are only a handful of user accounts, it  becomes unusable when there are hundreds or thousands of users. This tutorial looks at building an interface to efficiently and easily select one user account from a large number of accounts. 
  • Recovering and Changing Passwords [VB | C#] - shows how to use the PasswordRecovery and ChangePassword controls to allow users and administrators to recover lost passwords and change existing passwords.
  • Unlocking and Approving User Accounts [VB | C#] - as a security measure, if a user supplies an incorrect password too many times, they are locked out. Users may also be unapproved. In either case, they cannot login. This tutorial examines how these properties are set, how they can be modified by an administrator, and how the user's approved status can be utilized to prevent new users from logging in until some action has been completed (such as clicking a link in an email message or receiving approval from an administrator).

All tutorials are available in C# and VB versions, include a complete, working source code download, and are available to download as PDF. The next batch of tutorials examines creating administrative pages to manage user accounts.

Enjoy! - http://asp.net/learn/security/

posted on Wednesday, April 02, 2008 10:55 PM

Feedback

# re: Final Three Security Tutorials Published 4/11/2008 5:51 AM Richard

There's a nasty bug [1] in the PasswordRecovery and ChangePassword controls, where the body of the email message will be corrupted if the new password contains any of: "$0", "$&", "$+", "$`", "$'" or "$_".

The MailDefinition.CreateMailMessage method uses Regex.Replace to insert any replacement strings, but doesn't properly escape the inserted values. All of the strings above act as substitutions [2], which causes the incorrect value to be inserted.

[1] https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=302939
[2] http://msdn2.microsoft.com/en-us/library/ewy2t5e0.aspx

# 11 april Links: ASP.NET, ASP.NET AJAX, ASP.NET MVC, VISUAL STUDIO, Silverlight 4/12/2008 3:29 AM Scott Guthrie's Blog in Dutch

11 april Links: ASP.NET, ASP.NET AJAX, ASP.NET MVC, VISUAL STUDIO, Silverlight ASP.NET Meer ASP.NET Beveiliging

# لینک های یازدهم آوریل: ASP.NET,ASP.NET AJAX,ASP.NET MVC, Visual Studio,Silver Light 4/17/2008 5:22 AM وبلاگ اسکات گوسری به زبان فارسی

ASP.NET: ????? ??? ????? ????? ?? ASP.NET : ?? ????? ??? ? ???? ????? ???? ?? ???? ????? ASP.NET ?? ?????

# ASP.NET,ASP.NET AJAX,ASP.NET MVC,Visual Studio,Silver Light:لینک های یازدهم آوریل 4/17/2008 5:27 AM وبلاگ اسکات گوسری به زبان فارسی

ASP.NET: ????? ??? ????? ????? ?? ASP.NET : ?? ????? ??? ? ???? ????? ???? ?? ???? ????? ASP.NET ?? ?????

# Final Three Security Tutorials Published | ASP.NET Security Watch 6/25/2009 6:17 PM Pingback/TrackBack

Final Three Security Tutorials Published | ASP.NET Security Watch

# re: Final Three Security Tutorials Published 7/1/2009 9:29 PM Sanjivani

Hi Scott,

I read your article on asp.netr security (http://www.asp.net/learn/security/tutorial-13-cs.aspx">http://www.asp.net/learn/security/tutorial-13-cs.aspx). I did not find link to write you so asking for help here. Sorry for writing at wrong place.
Please help me out in getting my forgot password form working.
In the article (http://www.asp.net/learn/security/tutorial-13-cs.aspx">http://www.asp.net/learn/security/tutorial-13-cs.aspx), flowchart says, if requiresQuestionAndAnswer is true PasswordRecovery control will ask security question and answer but in my case, it says "Your attempt to retrieve your password was not successful. Please try again."
I have a custom class for MembershipProvider. In web.config I have,

<membership
defaultProvider="SQLsMemProvider" >
<providers>
<clear/>
<add name="SQLsMemProvider"
enablePasswordRetrieval="false"
enablePasswordReset="true"
type="SQLMembershipProvider"
requiresQuestionAndAnswer="true"
connectionStringName="SQLConnString"
providerName="System.Data.SqlClient"
applicationName="/"
passwordFormat="Encrypted"
/>

</providers>
</membership>

When I debug application from Forgot Password page, it goes to GetUser() method and then RequiresQuestionAndAnswer property. if RequiresQuestionAndAnswer is true ,PasswordRecovery controls shows message "Your attempt to retrieve your password was not successful. Please try again.". Rather it should ask for security question and answer. If I set RequiresQuestionAndAnswer to false, it checks for EnablePasswordRetrieval and EnablePasswordReset. IF EnablePasswordReset is true, it goes to ResetPassword method. but I dont know what to write in ResetPassword().
I want security question and answer to be displayed by PasswordRecovery control.

Please help me in this.

Thanks
Sanjivani

Title:  
Name:  
Url:
Protected by Clearscreen.SharpHIPEnter the code you see:
Comments   

My Links

Ads Via DevMavens

Archives

Post Categories

 

I am a Microsoft MVP for ASP.NET.
I am an ASPInsider.
<July 2009>
SMTWTFS
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678

Comment Stats

DayTotal% of Total
Sunday 2046.9%
Monday 42314.3%
Tuesday 50116.9%
Wednesday 54518.4%
Thursday 57219.3%
Friday 53618.1%
Saturday 1856.2%
Total 2966100.0%

Hour1Total% of Total
12:00 AM 752.5%
1:00 AM 802.7%
2:00 AM 672.3%
3:00 AM 812.7%
4:00 AM 642.2%
5:00 AM 1234.1%
6:00 AM 1153.9%
7:00 AM 1755.9%
8:00 AM 1876.3%
9:00 AM 1565.3%
10:00 AM 1866.3%
11:00 AM 1926.5%
12:00 PM 1996.7%
1:00 PM 1846.2%
2:00 PM 1675.6%
3:00 PM 1344.5%
4:00 PM 1153.9%
5:00 PM 1063.6%
6:00 PM 993.3%
7:00 PM 1063.6%
8:00 PM 903.0%
9:00 PM 842.8%
10:00 PM 893.0%
11:00 PM 923.1%
Total 2966100.0%

Comments by Blog Entry Date/Time

Day Entry MadeAvg.Total
Sunday 4.91157
Monday 4.92379
Tuesday 4.21471
Wednesday 7.42668
Thursday 6.53666
Friday 5.17450
Saturday 4.73175
Total 5.522966

Hour1 Entry MadeAvg.Total
12:00 AM 5.2937
1:00 AM 1.002
5:00 AM 0.000
7:00 AM 4.0048
8:00 AM 4.29133
9:00 AM 6.04290
10:00 AM 5.83274
11:00 AM 4.36192
12:00 PM 6.44348
1:00 PM 3.14132
2:00 PM 5.04227
3:00 PM 7.97303
4:00 PM 3.8199
5:00 PM 6.00168
6:00 PM 4.56114
7:00 PM 8.95188
8:00 PM 8.58163
9:00 PM 5.00115
10:00 PM 6.31101
11:00 PM 4.5732
Total 5.522966

Learn More About Comment Stats
1 - All times GMT -8...


Blog Stats

Favorite Web Sites

My Books

My MSDN Articles