ASP.Net Membership Provider Lab and Walkthrough
Installing the Built-In SQLMembership Provider
SQL Server Name: NMTW-CA0AF8755E\SQLEXPRESSDatabase Name: ASPNETBD
Steps Notes
1. Install SQL 2005/2008 Express.
2. Configure SQL Server for Remote Access Use the SQL Surface Area Configuration tools
3. Turn off Firewall and Virus protection4. Install Membership Provider DB
A. Ensure that the SQL Service is running.B. Run the following file:
C:\WINDOWS\microsoft.NET\Framework\v2.0.50727\aspnet_regsql.exe
In control panel services check for(MSSQL$SQLEXPRESS) is running (Services)
5. Create new Web project in Visual Studio Name it ArchitectFactory
6. Modify the Web.config and add a ConnectionString called “LocalServer”
<connectionStrings> <clear/> <add name="LocalSQLServer" connectionString="Server=NMTW-CA0AF8755E\SQLEXPRESS;Database=aspnetdb;Trusted_Connection=Yes;"/> </connectionStrings>
7. Run ASP.Net Configuration Open Visual Studio, Select the WEB APPLICTION then choose Menu - Project/Asp .Net Configuration
8. Create New User using ASP.Net Configuration
20 Marion DriveTewksbury, MA 01876
Phone:781-389-9695 www.CodeRight.com
Using the Built-In Login Controls
Create three Web pages: CreateUser.aspx, Login.aspx, and Default.aspx
Steps Notes
1. Create new Web page “CreateUser.aspx” Add a CreateUserWizard to the web page
2. Create new Web page “Login.aspx” Add a Login.aspxAdd a LoginView Control to the FormAdd a Login Control to the form
3. Create a new Web page “Default.aspx” Add Welcome Text to the pageAdd a LoginStatus
4. Configure Web.config Set “FORMS” authentication
20 Marion DriveTewksbury, MA 01876
Phone:781-389-9695 www.CodeRight.com
Implement Custom Membership Provider for Tricipher
Create a new Class Project.
Add references for B2F and APINET2
Steps Notes
1. Create new Class Library Project named TricipherProvider
2. Add in AppUtil.cs and B2FUtil.cs [Enter Directory Here]
3. Create User.cs class inherit from “MembershipUser”.
A. Add the following Properties
public string ActivationCode; public bool Active = false; public bool Authenticated = false; public string Certificate; public bool DeviceValid = false; public int ImagePage; public bool KBAValid = false; public string Password; public string Question1; public string Question2; public string Question3; public sbyte[] WelcomeImage;
4. Add Project References:
System.Web System.Configuration Apinet2 B2F2
5. Rename Class1 named: CustomMembershipProvider and inherit from “MembershipProvider”
Right click MembershipProvider and Select Implement Abstract Class
6. Add the required Tricipher namespaces following Namespaces:
using B2F;using System.Collections;using System.Collections.Specialized;using System.Runtime.InteropServices;using System.Web.Security;
20 Marion DriveTewksbury, MA 01876
Phone:781-389-9695 www.CodeRight.com
using Trc;
7. Remove ValidateUser method Toolbox snipits
Replace with ValidateUser
8. Add Initialize and CreateUser Toolbox snipits
9. Configure Web.config of Web Application Copy Application Settings from Web.config (Ctrl C then Ctrl z to remove extra spaces)
20 Marion DriveTewksbury, MA 01876
Phone:781-389-9695 www.CodeRight.com
Top Related