Module 7: Creating a Microsoft ASP.NET Web Application.

Slides:



Advertisements
Similar presentations
Forms Authentication, Users, Roles, Membership Ventsislav Popov Crossroad Ltd.
Advertisements

CIS 451: ASP Sessions and Applications Dr. Ralph D. Westfall January, 2009.
Building Applications using ASP.NET and C# / Session 1 / 1 of 21 Session 1.
Authenticating Users in an ASP.NET Application. Web Site Administration Tool From VS 2008, click Website/ ASP.Net Configuration to open Web Site Administration.
Microsoft ASP.NET Security Venkat Chilakala Support Professional Microsoft Corporation.
Building ASP.NET Applications 2 Lecture 3,4 T. Ahlam Algharasi 4 th Level.
ASP.NET 2.0 Chapter 6 Securing the ASP.NET Application.
Internet Information Server (IIS)
Role based Security in.NET By By Aasia Riasat Aasia RiasatCS-795.
 Mark Friedman Architect Developer Division Microsoft Corporation.
Christopher M. Pascucci Basic Structural Concepts of.NET Browser – Server Interaction.
IT533 Lectures Configuring, Deploying, Tracing and Error Handling.
Session 11: Security with ASP.NET

Session 10: Managing State. Overview State Management Types of State Management Server-Side State Management Client-Side State Management The Global.asax.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 Managing State.
State Management. What is State management Why State management ViewState QueryString Cookies.
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 Securing a Microsoft ASP.NET Web Application.
The Web Architecture and ASP.NET. Slide 2 Review of the Web (1) It began with HTTP and HTML, which delivers static Web pages to browsers which would render.
Murach’s ASP.NET 4.0/VB, C1© 2006, Mike Murach & Associates, Inc.Slide 1.
Oracle Application Express Security. © 2009 Oracle Corporation Authentication Out-of-the-Box Pre-Configured Schemes LDAP Directory credentials Oracle.
Tracing 1www.tech.findforinfo.com. Contents Why Tracing Why Tracing Tracing in ASP.NET Tracing in ASP.NET Page Level tracing Page Level tracing Application.
1 CS 3870/CS 5870: Note 11 Authentication and Authorization Membership Provider.
1 Maryland ColdFusion User Group Session Management December 2001 Michael Schuler
1 CS 3870/CS 5870 Note04 Session Variables and Post Back.
Effective Security in ASP.Net Applications Jatin Sharma: Summer 2005.
The.NET Runtime and IIS Presented by Chris Dickey – cdickey.net consulting
Dr. Azeddine Chikh IS444: Modern tools for applications development.
Christopher M. Pascucci Basic Structural Concepts of.NET Managing State & Scope.
ASP.NET State Management. Slide 2 Lecture Overview Client state management options Cookies Server state management options Application state Session state.
1 CS 3870/CS 5870: Note 07 Lab 3 Lab 4 Test 1: Two Tables.
STATE MANAGEMENT.  Web Applications are based on stateless HTTP protocol which does not retain any information about user requests  The concept of state.
Module 11: Securing a Microsoft ASP.NET Web Application.
Slide 1 ASP Authentication There are basically three authentication modes Windows Passport Forms There are others through WCF You choose an authentication.
Website Security ISYS 512. Authentication Authentication is the process that determines the identity of a user.
Module 1: Working with ASP.NET. Overview Introducing ASP.NET Creating Web Forms Adding ASP.NET Code to a Page Handling Page Events Discussion: ASP vs.
Web Database Programming Week 7 Session Management & Authentication.
ASP (Active Server Pages) by Bülent & Resul. Presentation Outline Introduction What is an ASP file? How does ASP work? What can ASP do? Differences Between.
IIS and.Net security -Vasudha Bhat. What is IIS? Why do we need IIS? Internet Information Services (IIS) is a Web server, its primary job is to accept.
1 CS 3870/CS 5870: Note 12 Authentication and Authorization Membership Provider.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
ASP.NET P AGE O BJECTS.  Each ASP.NET page inherits the PAGE object  The PAGE supplies 3 built in objects:  REQUEST: All information passed to the.
CSC 2720 Building Web Applications Basic Frameworks for Building Dynamic Web Sites / Web Applications.
Configuring and Deploying Web Applications Lesson 7.
1 CS 3870/CS 5870: Note 14. Prog5 Due 10 PM Wednesday, Oct 21 Authentication and Authorization 2.
Module 5: Managing Content. Overview Publishing Content Executing Reports Creating Cached Instances Creating Snapshots and Report History Creating Subscriptions.
Session 11: Cookies, Sessions ans Security iNET Academy Open Source Web Development.
Building web applications with the Windows Azure Platform Ido Flatow | Senior Architect | Sela | This session.
ASP.NET 2.0 Security Alex Mackman CM Group Ltd
Introduction to ASP.NET development. Background ASP released in 1996 ASP supported for a minimum 10 years from Windows 8 release ASP.Net 1.0 released.
ASP.NET Essentials State management, authentication, and Web Services Daniele Pagano Arizona State University.
111 State Management Beginning ASP.NET in C# and VB Chapter 4 Pages
ASP – Web Programming Class  Ravi Anand. ASP – Active Server Pages What is ASP? - Microsoft Technology - Can Run using IIS/PWS/Others - Helps us create.
Managing State Chapter 13.
Agenda Introduction Security flow for a request Authentication
Authentication and Authorisation in ASP.Net
Session Variables and Post Back
State Management.
Y.-H. Chen International College Ming-Chuan University Fall, 2004
Security Basics and ASP.NET Support
Jim Fawcett CSE686 – Internet Programming Summer 2005
Security mechanisms and vulnerabilities in .NET
ASP.NET Application Framework
Application Infrastructure
Created by : Asst. Prof. Ashish Shah
ASP.NET Module Subtitle.
ASP.NET 4.0 State Management Improvements – Deep Dive
© 2016, Mike Murach & Associates, Inc.
Caching.
Presentation transcript:

Module 7: Creating a Microsoft ASP.NET Web Application

Overview Requirements of a Web Application What Is New in ASP.NET? Sharing Information Between Pages Securing an ASP.NET Application

Requirements of a Web Application State Maintenance Security Performance and Scalability Easy Configuration Easy Deployment

 What Is New in ASP.NET? Cookie-less Session IDs Configuration File (web.config) Setting Up Cookie-less Sessions Global Application File (Global.asax) Demonstration: Using Event Procedures in Global.asax Page Caching

Cookie-less Session IDs Each Active Session Is Identified and Tracked Using Session IDs SessionIDs Are Communicated Across Client-Server Requests Using an HTTP Cookie or Included in the URL Using a Cookie Default mechanism for storing SessionIDs Cookie-less Sessions Information is encoded into URLs

Configuration File (web.config) All Configuration Information for an ASP.NET Application Is Contained in web.config Web.config Can Be Placed in the Same Folder as the Application Files Web.config Contains Sections for Each Major Category of ASP.NET Functionality <trace enabled="true" requestlimit="40" pageoutput="true"/> <trace enabled="true" requestlimit="40" pageoutput="true"/>

Setting Up Cookie-less Sessions Session State Is Configured in the Section of web.config Settings: cookieless timeout Setting Up Cookie-less Session mode sqlConnectionString

Global Application File (Global.asax) Global.asax is Similar to Global.asa in ASP Applications Global.asax Supports More Than 15 Events As page is requested: BeginRequest, AuthenticateRequest, AuthorizeRequest As page is returned: EndRequest

Demonstration: Using Event Procedures in Global.asax

Page Caching Output Caching Caches content generated from dynamic pages Page is compiled into IL and native code Native code is cached as Page class and is available to serve for the next request Page class is updated when the source ASP.NET file is changed or cache timeout happens Setting the Cache Timeout

 Sharing Information Between Pages Using ASP.NET Cache Using web.config Variables Demonstration: Using web.config Variables Using Session and Application Variables Demonstration: Using Session Variables Saving Session and Application Variables in a Database Discussion: Different Ways of Sharing Information

Using ASP.NET Cache ASP.NET Cache: Stores objects and values for reuse in an application Placing Objects in ASP.NET Cache Retrieving Objects From ASP.NET Cache Cache.Insert("mykey", myValue, _ Nothing, DateTime.Now.AddHours(1), _ TimeSpan.Zero) Cache.Insert("mykey", myValue, _ Nothing, DateTime.Now.AddHours(1), _ TimeSpan.Zero) myValue = Cache("mykey") If myValue <> Nothing Then DisplayData(myValue) End If myValue = Cache("mykey") If myValue <> Nothing Then DisplayData(myValue) End If

Using web.config Variables Store Application Variables in web.config Retrieve in an.aspx File <add key="pubs" value= "server=localhost;uid=sa;pwd=;database=pubs"/> <add key="pubs" value= "server=localhost;uid=sa;pwd=;database=pubs"/> Dim appSetting As NameValueCollection Dim strConn As String appSetting = CType(Context.GetConfig _ ("appsettings"), NameValueCollection ) strConn = appSetting("pubs").ToString() Dim appSetting As NameValueCollection Dim strConn As String appSetting = CType(Context.GetConfig _ ("appsettings"), NameValueCollection ) strConn = appSetting("pubs").ToString()

Demonstration: Using web.config Variables

Using Session and Application Variables Session Object Stores Information for a Particular User Session Application Object Shares Information Among All Users of a Web Application Sub Session_Start(s As Object, e As EventArgs) Session("BackColor") = "beige" Session("ForeColor") = "black" End Sub Sub Session_Start(s As Object, e As EventArgs) Session("BackColor") = "beige" Session("ForeColor") = "black" End Sub Sub Application_Start(s As Object, e As EventArgs) Application("NumberofVisitors") = 0 End Sub Sub Application_Start(s As Object, e As EventArgs) Application("NumberofVisitors") = 0 End Sub

Demonstration: Using Session Variables

Saving Session and Application Variables in a Database Session State Can Be Stored in a Separate SQL Server Database A Temporary Table Is Used for the Serialized Session Data Advantages: State can be recovered even if an application crashes An application can be partitioned across multiple Web farm machines

Discussion: Different Ways of Sharing Information

 Securing an ASP.NET Application What Is Authentication? Forms Authentication Architecture Setting Up Security in web.config Creating a Login Form Demonstration: Setting Up Security in web.config

What Is Authentication? Authentication Accept credentials from a user Validate the credentials Types of ASP.NET Authentication Windows authentication Passport authentication Forms authentication

Forms Authentication Architecture Client requests page Authorized ASP.NET Authentication Not Authenticated Authenticated Login Page (Users enter their credentials) Authenticated Cookie Authorized Not Authenticated Access Denied Requested Page 

Setting Up Security in web.config Setting Up Authentication Setting Up Authorization

Creating a Login Form Login Page Verifies and Checks the Credentials of a User Login page validates user credentials and redirects if valid Reading User Credentials from Cookie User.Identity.Name returns the value saved by CookieAuthentication.RedirectFromLoginPage Sub cmdLogin_Click(s As Object, e As EventArgs) If (login(txt .Value, txtPassword.Value)) FormsAuthentication.RedirectFromLoginPage _ (txt .Value, False) End If End Sub Sub cmdLogin_Click(s As Object, e As EventArgs) If (login(txt .Value, txtPassword.Value)) FormsAuthentication.RedirectFromLoginPage _ (txt .Value, False) End If End Sub

Demonstration: Setting Up Security in web.config

Lab 7: Creating an ASP.NET Web Application

Review Requirements of a Web Application What Is New in ASP.NET? Sharing Information Between Pages Securing an ASP.NET Application