1 CS 3870/CS 5870: Note 13 Lab 6 Authentication and Authorization Roles Management.

Slides:



Advertisements
Similar presentations
Editorial roles Members of a Manila site can be assigned an editorial role if you want to grant them access to write stories or modify the appearance of.
Advertisements

Help File For User Creation Click the “Course” button for Creating/Add User.
Creating a Login Process Creating a users table and a login form that denies access to unauthorized users.
The Librarian Web Page Carol Wolf CS396X. Create new controller  To create a new controller that can manage more than just books, type ruby script/generate.
1 CS 3870/CS 5870: Lab4 Save with Invalid Price Keep Order After Updating.
Members Only & Login Modules Members Only works with the Login module to provide password protection to Web pages and files. Login Groups may be created.
ASP.NET Security MacDonald Ch. 18 MIS 424 MIS 424 Professor Sandvig Professor Sandvig.
Authenticating Users in an ASP.NET Application. Web Site Administration Tool From VS 2008, click Website/ ASP.Net Configuration to open Web Site Administration.
Building ASP.NET Applications 2 Lecture 3,4 T. Ahlam Algharasi 4 th Level.
CONFIGURING WINDOWS SERVER MIS 424 Professor Sandvig.
1 CS 3870/CS 5870 Static and Dynamic Web Pages ASP.NET and IIS.
Session 5: Working with MySQL iNET Academy Open Source Web Development.
1 CS 3870/CS 5870 Static and Dynamic Web Pages ASP.NET and IIS.
Forms Authentication, Users, Roles, Membership Svetlin Nakov Telerik Corporation
1.NET Web Forms Security Issues © 2002 by Jerry Post.
Needs for Accessing Database To make your web site more dynamic and maintainable, you can display information on your web pages that are retrieved from.
1 Data Bound Controls II Chapter Objectives You will be able to Use a Data Source control to get data from a SQL database and make it available.
Quick Start Guide: Administrator Basics Learn about: 1.Adding users to the LOAMS system 2.How to modify or delete existing users 3.How to reset passwords.
1 CS 3870/CS 5870: Note 11 Authentication and Authorization Membership Provider.
Unit 8.3 Learning Objectives Insert users into the ASP.NET Membership system from code Capture data being sent to the database Capture Exceptions that.
1 CS 3870/CS 5870 Note04 Session Variables and Post Back.
Effective Security in ASP.Net Applications Jatin Sharma: Summer 2005.
CSCI 6962: Server-side Design and Programming Database Manipulation in ASP.
CS 3630 Database Design and Implementation. Assignment 3 Style! Agreement between database designer and the client. UserName1_EasyDrive UserName2_EasyDrive.
Web Scripting [PHP] CIS166AE Wednesdays 6:00pm – 9:50pm Rob Loy.
ASP.NET The Clock Project. The ASP.NET Clock Project The ASP.NET Clock Project is the topic of Chapter 23. By completing the clock project, you will learn.
Chapter 8 Working With Databases in ASP.NET. Listing 8.1 – ShowListControls Uses The SqlDataSource control for estabishing database connectivity and.
1 CS 3870/CS 5870: Note 07 Lab 3 Lab 4 Test 1: Two Tables.
Module 7: Creating a Microsoft ASP.NET Web Application.
What is Web Site Administration Tool ? WAT Allow you to Configure Web Site With Simple Interface –Manage Users –Manage Roles –Manage Access Rules.
1 CS 3870/CS 5870: Note05 Prog3 Web Application with Database.
Table of Contents TopicSlide Administrator Login 2 Administrator Navigations 3 Managing AlternativeDr.com Blogs 4 Managing Dr. Lloyd May Blogs 5 Managing.
1 CS 3870/CS 5870: Note 19 SiteMap and AJAX Lab 8.
1 CS 3870/CS 5870: Note 18 SiteMap Prog8. Test 2 50 Points Thursday, Nov 12 2:00 PM – 4:00 PM Lab
The Diagnostic Pathfinder System Introduction Getting Started.
NIMAC for Publishers: How to Create Sub User Accounts December 2015.
1 CS387/CS587: Note05 Lab 3. 2 Global.asax Must not be under any sub-folder Application_Start Application_End Application_Error Session_Start Session_End.
1 CS 3870/CS 5870: Note 12 Authentication and Authorization Membership Provider.
From “Control Panel”, launch “Programs and Features” then select “Turn Windows features on or off” Lab 2: Setup Lab Environment.
1 CS 3870/CS 5870: Note 16 Web User Controls. Prog 7 Copy Prog6 to Prog7 Modify all files for Prog7 Remove Web.config from sub-folders Make sure Prog7.
ADO.NET FUNDAMENTALS BEGINNING ASP.NET 3.5 IN C#.
Information Management System “Institutions Module" Information Management System “Institutions Module" The System management module is an integrated part.
Chapter 13Introduction to Oracle9i: SQL1 Chapter 13 User Creation and Management.
1 CS387/CS587: Note04 Lab 3. 2 Master Page All Web pages will be similar Should be created before other web pages Add New Items Controls on the Master.
1 CS 3870/CS 5870: Note 13 Web Service. 2 What is Web Service? Providing functionality online to other Web applications SOAP Simple Object Access Protocol.
Configuring and Deploying Web Applications Lesson 7.
1.NET Web Forms Applications: Main Form © 2002 by Jerry Post.
1 CS 3870/CS 5870: Note 14. Prog5 Due 10 PM Wednesday, Oct 21 Authentication and Authorization 2.
1 CS 3870/CS 5870: Note07 Prog 4. Master Pages Creating a master page based on another master page MainMasterPage –For all Progs and Tests Prog4MasterPage.
1 CS 3870/CS 5870: Note07 Prog 4. Master Pages Creating a master page based on another master page MainMasterPage –For all Progs and Tests Prog4MasterPage.
CSCI 6962: Server-side Design and Programming Shopping Carts and Databases.
1 CS 3870/CS 5870: Note 19 AJAX Prog8. Test 2 50 Points Thursday, Nov 12 2:00 PM – 4:00 PM Lab
Installing and Configuring Moodle. Download Download latest Windows Install package from Moodle.orgMoodle.org.
USER MANAGEMENT Ver 2 Assigning/Removing School Head and Reset Password By ALFREDO C. MEDRANO Planning Officer II.
Labcheck Next Generation Quick Start Guide Admin Basics.
COM621: Advanced Interactive Web Development Lecture 10 PHP and MySQL.
1. Prog3 Try and Catch Testing 2 Catching Database Errors Protected Sub DetailsView1_ItemDeleted( sender As Object, e As DetailsViewDeletedEventArgs)
Creating Data Base & Sql Data Source
Unit 7 Learning Objectives
Web Application with Database
CS 3870/CS 5870 Web User Controls.
Session Variables and Post Back
Listing 9.1 ShowLocalConnection.aspx
To Join the Teleconference
CS 3870 Prog6 Roles Management Due Monday, November 5 Group Assignment.
CS 3870 Prog5 Shopping Bag.
Creating Data Base & Sql Data Source
Web Application with Dataase
SOP of System Security Settings
Security - Forms Authentication
Presentation transcript:

1 CS 3870/CS 5870: Note 13 Lab 6 Authentication and Authorization Roles Management

2 Lab 6 Copy folder Lab5 as Lab6 Modify Master Page and Content Pages Add Session Variables for Lab6 Make sure Lab6 is working

One SQLDataSource for Lab6 Make a copy of your Lab6 Remove the SqlDataSource from all three pages Close the three pages 3

One SQLDataSource for Lab6 Lab6MasterPage Add an SQLDataSource control before or after the new ContentPlaceHolder Configure the data source Generate Insert/Delete/Update commands Uncheck Use optimistic concurrency 4

Delete Command Lab6MasterPage Source DeleteCommand DeleteCommand="DELETE FROM [Product] WHERE [ProductID] (Uncheck Use optimistic concurrency) DataKeyNames: ProductID 5

Function getDataSource Partial Class Lab6_MasterPage Public Function getDataSource() As SqlDataSource Return mySqlDataSource End Function Protected Sub LoginStatus1_LoggedOut(...) Handles LoginStatus1.LoggedOut Response.Redirect("~/Login.aspx") End Sub End Class 6

Default Page Open Default.aspx in Design View Click the Smart Tag Change SqlDataSource1 to –mySqlDataSource Auto-Generate fields Close the Smart Tag Refresh Fields and Keys for GridView1 –Yes 7

Shopping.aspx Page Directive 8

Shopping.apsx.vb Protected Sub txtID_TextChanged Dim id As String ‘ get id from session variable Dim db As SqlDataSource = Master.getDataSource Dim dv As System.Data.DataView = db.Select(DataSourceSelectArguments.Empty) dv.RowFilter = "ProductID = '" & id & "'“ If dv.Count = 1 Then 9

Updating.aspx Page Directive 10

Updating Page Open Updating.aspx in Design View Click the Smart Tag Change SqlDataSource1 to –mySqlDataSource Close the Smart Tag Refresh Fields and Keys for DetailsView1 –Yes if asked 11

Delete on Updating.aspx DetailsView1 DataKeyNames: ProductID 12

Inserting on Updating.apsx Protected Sub DetailsView1_ItemInserted(...) Handles... Dim id As String = txtID.Text.Trim Dim db As SqlDataSource = Master.getDataSource Dim dv As System.Data.DataView = db.Select(DataSourceSelectArguments.Empty) For... ‘ setting DetailsView1.PageIndex 13

Creating Roles Enabling RoleManager Web.config under the root folder Default is False 14

New Users UserName: Windows Role: Member Password: your UWP Other: your choice 15

New Users UserName: WebProtocols Roles: Admin and Member Password: your UWP Other: your choice 16

17 Page SetRoles

18 Private Sub ListRolesBind() lstRoles.DataSource = Roles.GetAllRoles() lstRoles.DataBind() End Sub Protected Sub Button1_Click(...) Handles Button1.Click Roles.CreateRole(txtRole.Text) ListRolesBind() End Sub Protected Sub Button2_Click(...) Handles Button2.Click Roles.DeleteRole(txtRole.Text) ListRolesBind() End Sub Protected Sub Button3_Click(...) Handles Button3.Click Roles.AddUserToRole(txtUser.Text, lstRoles.SelectedValue) ListUsersBind() End Sub

19 Private Sub ListUsersBind() lstUsersInRole.DataSource = Roles.GetUsersInRole(lstRoles.SelectedValue) lstUsersInRole.DataBind() End Sub Protected Sub Button4_Click(...) Handles Button4.Click Roles.RemoveUserFromRole(lstUsersInRole.SelectedValue, lstRoles.SelectedValue) ListUsersBind() End Sub Protected Sub lstRoles_SelectedIndexChanged(...) Handles lstRoles.SelectedIndexChanged ListUsersBind() End Sub

20 Web.Config Application Configuration File under the main web site

21 Role Management Users in role Admin can access page SetRoles User in role Member cannot access page SetRoles, but can access page Default

Multiple Locations This may not work! Create sub-folders! 22

23 Sub-Folders and Pages Member Default Shopping Checkout Admin Updating SetRoles

24 Authorization Configuration File under the folder Admin

25 Authorization Configuration File under the folder Member

Schedule Thursday (10-16): Lab206 –Lose 5 points if missing class Saturday (10-18): –Basic functionalities for bonus points Monday (10-20): Lab6 is due at 5pm Tuesday (10-21): Review for Test2 Thursday (10-23): Test2 26

Test 2 Lab5 and Lab6 Authentication and Authorization Login Create User and Roles Assign users to roles Accessing Database 27