Docsity

Forms Authentication in ASP.NET: Configuration and Implementation, Slides of Computer Programming

Partial preview of the text

Download Forms Authentication in ASP.NET: Configuration and Implementation and more Slides Computer Programming in PDF only on Docsity!

ASP Authentication

 There are basically three authentication

modes

 Windows

 Passport

 Forms

 You choose an authentication mechanism in

the web.config file

Windows Authentication

 Here you are relying on the internal Windows

authentication services

 IIS displays an authentication dialog box

 IIS validates the user

 Page access is granted based on Access Control

Lists

 Clients must be Windows machines

 Works well on intranets and corporate network

applications

 We don‟t use these in real-world Internet applications

Configuring Forms

Authentication (1)

 It‟s configured in the

section of the Web.config file

 Set the mode attribute to “forms”

 Set the Forms key to the login URL

Web.config for Forms

Authentication

<system.web>

<system.web>

Implementing Forms

Authentication (Steps)

 Enable membership for the application and

specify the membership provider

 This is done in the section of

the web.config file

 All of this is part if the ASP infrastructure

Implementing Forms

Authentication (Steps)

<membership defaultProvider="SqlProvider"

userIsOnlineTimeWindow="15">

<add name="SqlProvider"

type="System.Web.Security.SqlMembershipProvider"

connectionStringName="MySqlConnection"

applicationName="MyApplication"

enablePasswordRetrieval="false"

enablePasswordReset="true"

requiresQuestionAndAnswer="true"

requiresUniqueEmail="true"

passwordFormat="Hashed" />

The Web Site Administration

Tool

 Use the ASP.NET Web Site Administration tool

to

 Create and manage users

 Create and manage roles

 By default, the data is stored in an SQL

Server Express database

Web Site Admin Tool

(Example)