CS 3870 Prog6 Roles Management Due Monday, November 5 Group Assignment.

Slides:



Advertisements
Similar presentations
Unit 02. ASP.NET Introduction HTML & Server controls Postbacks Page Lifecycle.
Advertisements

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.
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.
1 Configuring Internet- related services (April 22, 2015) © Abdou Illia, Spring 2015.
Unit 5: Building Presentation Layer Applications with ASP.NET 2.0.
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.
Hands-On Microsoft Windows Server 2003 Administration Chapter 5 Administering File Resources.
ASP.NET 2.0 Chapter 6 Securing the ASP.NET Application.
Website Security ISYS 512. Cookies Data in Cookies System.Web Which web site set the cookie Expiration date –DateTime data type –TimeSpan data type One.
Kirkwood Scan to Set Up. Scan to Set up 1. Click on Start, Settings, Printers to get this screen.
Session 11: Security with ASP.NET

Forms Authentication, Users, Roles, Membership Svetlin Nakov Telerik Corporation
1.NET Web Forms Security Issues © 2002 by Jerry Post.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 Securing a Microsoft ASP.NET Web Application.
1 CS 3870/CS 5870: Note 11 Authentication and Authorization Membership Provider.
Go to your school’s web locker site school name.schoolweblockers.com) Your user name is the first letter of your first name, the first 4.
1 CS 3870/CS 5870 Note04 Session Variables and Post Back.
Vinay Dhareshwar.  Introduction  Membership Service  Login Controls  Role Management Service 2.
1 CS 3870/CS 5870: Note 13 Lab 6 Authentication and Authorization Roles Management.
Dynamic Dropdown Lists 1. Objectives You will be able to Use Dropdown Lists to solicit multiple choice user input in an ASPX web page. Populate a Dropdown.
1 CS 3870/CS 5870: Note 07 Lab 3 Lab 4 Test 1: Two Tables.
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.
What is Web Site Administration Tool ? WAT Allow you to Configure Web Site With Simple Interface –Manage Users –Manage Roles –Manage Access Rules.
Role Management in.NET Shree Shalini Pusapati CS /17/20151.
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
Module 4: Creating a Web Application with Web Forms
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.
Information Management System “Institutions Module" Information Management System “Institutions Module" The System management module is an integrated part.
Marco Bellinaso Senior Trainer & Consultant Code Architects Srl Building Dynamic Navigation Systems with Visual Studio 2005 and ASP.NET 2.0.
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.
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 Project 4 Address Lookup. Project 4 Write an ASP.NET app that permits users to retrieve addresses from a potentially large list of addresses. There.
11 User Controls Beginning ASP.NET in C# and VB Chapter 8.
Part 2.
Business Objects XIr2 Windows NT Authentication Single Sign-on 18 August 2006.
Chapter 7 Navigation. Objectives How to move around in your site using server controls and plain HTML How to address pages and other resources like images.
Authentication and Authorization
Site Maps and Navigation
CS 3870/CS 5870 Web Service.
Security In your webSite.
Unit 7 Learning Objectives
Agenda Introduction Security flow for a request Authentication
Allowing File Uploads.
Session Variables and Post Back
Security Basics and ASP.NET Support
CONTENT MANAGEMENT SYSTEM CSIR-NISCAIR, New Delhi
Configuring Cluster Communications
Website Navigation.
ASP.NET Web Configuration File
Application Infrastructure
State management & Master Pages in asp.net
CS 3870/CS 5870 Prog 6 Site Map.
CHƯƠNG IX: SITE NAVIGATION & USER CONTROL
CS 3870 Prog5 Shopping Bag.
Configuring Internet-related services
Module 10: Creating a Web Application with Web Forms
Role Management in .net Vinay Dhareshwar.
SOP of System Security Settings
NAVIGATION CONTROLS.
Active server pages (ASP.NET)
Security - Forms Authentication
Allowing File Uploads.
Website Navigation.
Presentation transcript:

CS 3870 Prog6 Roles Management Due Monday, November 5 Group Assignment

Roles Better approach to manage multiple users Roles for Prog6: Admin and Member Users in role Admin can access pages of Admin, but not pages of Member Users in role Member cannot access pages of Admin, but can access pages of Member One user could be in multiple roles

New User UserName: Windows Password: cs3340@UWP Email: your UWP email Other: your choice

New User UserName: WebApps Password: cs3870@UWP Email: your UWP email Other: your choice

New User UserName: Qi Password: 213@Ullrich Email: your UWP email Other: your choice

Users and Roles WebApps Windows Qi csse Admin and Member Member Admin Not in any roles

Web.config under the root folder Enabling RoleManager Web.config under the root folder <system.web> <roleManager defaultProvider="AlphaRoleProvider" enabled="true" cacheRolesInCookie="true" cookieName=".ASPROLES" cookieTimeout="30" cookiePath="/" cookieRequireSSL="false" cookieSlidingExpiration="true" cookieProtection="All"> <providers> <clear/> <add name="AlphaRoleProvider“ type="UWPCS3870.AlphaRoleProvider" connectionStringName="AlphaConnectionString" applicationName="CS3870" writeExceptionsToEventLog="false"/> </providers> </roleManager> </system.web>

Page SetRoles

Page Load //Load event initializes dropdown boxes. protected void Page_Load(object sender, EventArgs e) { if (IsPostBack) return; try ListUsersBind(); //get all users ListRolesBind(); //get all roles ListUsersInRolesBind(); } catch(Exception ex) . . .

//Binds all users to dropdown. private void ListUsersBind() { lstUsers.DataSource = Membership.GetAllUsers(); lstUsers.DataBind(); }

//Binds roles to dropdown. private void ListRolesBind() { try lstRoles.DataSource = Roles.GetAllRoles(); lstRoles.DataBind(); } catch(Exception ex) txtMessage.Text = ex.Message;

//Binds users of a certain role to dropdown. private void ListUsersInRolesBind() { try lstUsersInRoles.DataSource = Roles.GetUsersInRole(lstRoles.SelectedValue); lstUsersInRoles.DataBind(); } catch(Exception ex) txtMessage.Text = ex.Message;

//Adds a role to the system. protected void btnAddRole_Click(object sender, EventArgs e) { try //Role name is txtRoles.Text Roles.CreateRole(txtRoles.Text); txtMessage.Text = "Role " + txtRoles.Text + " has been added"; ListRolesBind(); ListUsersInRolesBind(); } catch(Exception ex) txtMessage.Text = ex.Message; protected void btnRemoveRole_Click( . . . )

//Adds a user to a role. protected void btnAddUserToRole_Click(. . .) { try Roles.AddUserToRole(lstUsers.Text, lstRoles.SelectedValue); txtMessage.Text = "User " + lstUsers.Text + " has been added to the role " + lstRoles.Text; ListUsersInRolesBind(); } catch(Exception ex) txtMessage.Text = ex.Message; protected void btnRemoveUserFromRole_Click( . . . )

‘ AutoPostBack: True Protected Sub lstRoles_SelectedIndexChanged(. . .) Handles lstRoles.SelectedIndexChanged ListUsersInRoleBind() End Sub

//Deletes a user. protected void btnDeleteUser_Click(object sender, EventArgs e) { try Membership.DeleteUser(lstUsers.Text, true); txtMessage.Text = "User " + lstUsers.Text + " has been deleted."; ListUsersBind(); ListUsersInRolesBind(); } catch(Exception ex) txtMessage.Text = ex.Message;

Main Web.Config <location path="Prog6/Member"> <system.web> <authorization> <allow roles=“Member"/> <deny users=“*" /> </authorization> </system.web> </location> <location path="Prog6/Admin"> <allow roles="Admin"/> <deny users="*" />

Authorization Configuration File under the folder Admin <system.web> <authorization> <allow roles="Admin"/> <deny users="*" /> </authorization> </system.web>

Authorization Configuration File under the folder Member <system.web> <authorization> <allow roles=“Member"/> <deny users="*" /> </authorization> </system.web>

Need One of Them, Not Both Main Web.config Web.config in subfolder

WebSite and ApplicationName Each student has a website on Alpha Physical folder Name: UWP username Website name in IIS : UWP username IIS Applicationpool : UWP username ApplicationName for membership and role management In the main Web.config

Prog 6 Must change the ApplicationName for both membership and role management to your UWP username Same on Test 2

Login UserName Displayed on program Master Page Could save it using Session variable Session("Prog6_UserName") = Page.User.Identity.Name Retrieve the UserName on any pages

You should be able to do it yourselves! Total on Page Checkout You should be able to do it yourselves!

Site Map XML File Web.sitemap Organize the pages in the site hierarchically Must be located in the application root directory Automatically picked up by the default site-map provider SiteMapDataSource

Creating File Web.sitemap Right click the application root Add Add New Site Map It could be created in a sub-folder, but won’t be recognized

Initial Web.sitemap <?xml version="1.0" encoding="utf-8" ?> <siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" > <siteMapNode url="" title="" description=""> <siteMapNode url="" title="" description="" /> </siteMapNode> </siteMap>

Web.sitemap Contains only one siteMapNode element The root node can contain any number of child siteMapNode elements The child notes can have their child notes Note Properties URL: can be empty, but no duplicate Title Description

Test 2 November 8 Group Test Prog5 and Prog6 Authentication and Authorization Login Create User and Roles Assign users to roles Accessing Database