SlideShare ist ein Scribd-Unternehmen logo
1 von 51
Chapter 13 Security, Membership, and Role Management If thou be’st not immortal, look about you: security gives way to conspiracy. The mighty gods defend thee! William Shakespeare, Julius Caesar, Act II, Scene 3
Overview ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Intro to ASP.NET Security ,[object Object],[object Object],[object Object],[object Object]
Intro to ASP.NET Security ,[object Object],[object Object],[object Object],[object Object],[object Object]
Security Concepts ,[object Object],[object Object],[object Object],[object Object]
Security Concepts ,[object Object],[object Object],[object Object],[object Object],[object Object]
IIS Security ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
IIS Security ,[object Object],[object Object],[object Object]
IIS Authentication ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
IIS Authentication ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
IIS Authentication ,[object Object],[object Object],[object Object],[object Object]
ASP.NET Security ,[object Object]
Impersonation ,[object Object]
Impersonation ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Impersonation ,[object Object],[object Object],[object Object],[object Object],[object Object]
Code Access Security ,[object Object],[object Object],[object Object],[object Object],[object Object]
Trust Levels No capability to interact with resources. Intended for sites with little dynamic content. Minimal Models a read-only application because no network access to other servers is allowed.  Low Permissions are limited to what the application can access in its own folder structure. Thus, although a medium trust application can access a SQL Server database, it cannot access files or folders outside its own virtual directory hierarchy. As well, it has no reflection permissions, so those applications that require reflection (such as the typical object/relational mapper) may not work. Intended to be used for hosting environments that contain multiple customers’ sites. Medium Code can use most of the .NET Framework. The limitations are no unmanaged code, no enterprise services, and limited use of reflection.  High The application is fully trusted. All .NET code is allowed to run and thus any .NET classes can be used (however, still subject to operating system and Windows ACL limitations).  This is the default. Full Description Trust Name
ASP.NET Authentication ,[object Object],[object Object],[object Object],<system.web> … <authentication mode=&quot;Windows&quot; /> </system.web>
ASP.NET Authentication ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Forms Authentication <system.web>  …  <authentication mode=&quot;Forms&quot; > <forms loginUrl=&quot;Login.aspx&quot; />  </authentication> <authorization> <deny users=&quot;?&quot;/> </authorization> </system.web>
Forms Authentication ,[object Object]
Where to store user credentials? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Form Authentication ,[object Object],[object Object],[object Object]
How does it work? ,[object Object],[object Object],[object Object]
How does it work?
Cookieless Tickets ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Provider Model ,[object Object],[object Object],[object Object],[object Object]
Providers ,[object Object],[object Object]
Provider Model
Benefits of Provider Model ,[object Object],[object Object],[object Object],[object Object]
Provider-based Services Manages the special set of controls for creating Web sites that enable end users to modify the content, appearance, and behavior of Web pages directly within the browser. Web Parts Used by ASP.NET health monitoring subsystem that allows the monitoring of a Web application. Web events Provides a description of a site’s structure.  Site map Maintains user state between requests. Session state Handles role-based security. Role management Manages user preferences and user information across visits. Profile Manages user accounts. Membership Handles encryption and decryption of sections of the ASP.NET configuration files. Encryption Description Service
Provider Classes
Membership Provider ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
SqlMembership Provider ,[object Object],[object Object],[object Object],[object Object],[object Object]
WAT
Membership API ,[object Object],[object Object],[object Object]
Membership Class Returns true if the specified user name and password are valid (i.e., exist in the data store). ValidateUser Updates the data source with the information contained in the specified MembershipUser object. UpdateUser Returns the user name for the specified email. GetUserNameByEmail Returns a MembershipUser object for the current logged on user. GetUser Gets the number of users that is currently accessing the application. GetNumberOfUsersOnline Returns a MembershipUserCollection of all users. GetAllUsers Generates a random password of the specified length. GeneratePassword Returns a MembershipUserCollection of users whose user name matches the passed user name. FindUsersByName Returns a MembershipUserCollection of users whose email matches the passed email. FindUsersByEmail Deletes an existing user from the membership data store. DeleteUser Adds a new user to the membership data store. CreateUser Description Name
Role Management Provider ,[object Object],[object Object],[object Object],[object Object]
Login Controls ,[object Object],[object Object]
Login Controls Allows user passwords to be retrieved and sent to the email for that account. PasswordRecovery Displays one of two possible interfaces: one for authenticated users and one for anonymous users. LoginView Displays a login link for nonauthenticated users and a logout link for authenticated users. LoginStatus Displays the name of the authenticated user. LoginName Displays a customizable user interface for gathering user credentials. Login Based on the Wizard control covered in Chapter 4. A multistep process for gathering the user name, password, email address, and password question and answer. CreateUserWizard Lets users change their password. ChangePassword Description Name
Login Control <asp:Login ID=&quot;logSignin2&quot; runat=&quot;server&quot;  TextLayout=&quot;TextOnTop&quot; CssClass=&quot;loginStyle&quot;> <TitleTextStyle CssClass=&quot;loginTitle&quot; /> <InstructionTextStyle Font-Italic=&quot;True&quot; ForeColor=&quot;Black&quot; /> <TextBoxStyle Font-Size=&quot;0.8em&quot; /> <LoginButtonStyle CssClass=&quot;buttonStyle&quot; /> </asp:Login>
Other Controls ,[object Object],[object Object],[object Object],[object Object]
LoginName and LoginStatus Controls <asp:LoginName ID=&quot;logName&quot; runat=&quot;server&quot;  FormatString=&quot;Welcome {0}&quot; /> <asp:LoginStatus ID=&quot;logStat&quot; runat=&quot;server&quot; LoginImageUrl=&quot;images/btn_login.gif&quot; LogoutImageUrl=&quot;images/btn_logout.gif&quot; LogoutAction=&quot;Refresh&quot; />
LoginView Control ,[object Object],[object Object],[object Object]
LoginView Controls <asp:LoginView ID=&quot;logView&quot; runat=&quot;server&quot;> <AnonymousTemplate> <strong>For more features</strong><br /> <asp:LoginStatus ID=&quot;logStat&quot; runat=&quot;server&quot; LoginImageUrl=&quot;images/btn_login.gif&quot; LogoutImageUrl=&quot;images/btn_logout.gif&quot; LogoutAction=&quot;Refresh&quot; /> </AnonymousTemplate> <LoggedInTemplate> <strong>Rate this book</strong><br /> <asp:RadioButtonList ID=&quot;radList&quot; runat=&quot;server&quot;> <asp:ListItem Selected=&quot;true&quot;> No Rating</asp:ListItem> <asp:ListItem> <img src='images/stars1.gif'/></asp:ListItem> <asp:ListItem> <img src='images/stars2.gif'/></asp:ListItem> <asp:ListItem> <img src='images/stars3.gif'/></asp:ListItem> <asp:ListItem> <img src='images/stars4.gif'/></asp:ListItem> <asp:ListItem> <img src='images/stars5.gif'/></asp:ListItem> </asp:RadioButtonList> <asp:Button ID=&quot;btnRate&quot; runat=&quot;server&quot; Text=&quot;Rate Book&quot; /> </LoggedInTemplate> </asp:LoginView>
ChangePassword Control ,[object Object],[object Object],[object Object]
ChangePassword <asp:ChangePassword ID=&quot;chngPass&quot; runat=&quot;server&quot;  CssClass=&quot;passChangeStyle&quot; > <CancelButtonStyle CssClass=&quot;buttonStyle&quot; /> <ChangePasswordButtonStyle CssClass=&quot;buttonStyle&quot; /> <ContinueButtonStyle CssClass=&quot;buttonStyle&quot; /> <TitleTextStyle CssClass=&quot;titleStyle&quot; /> <TextBoxStyle CssClass=&quot;textboxStyle&quot; /> </asp:ChangePassword>
PasswordRecovery Control ,[object Object],[object Object],[object Object]
PasswordRecovery <asp:PasswordRecovery ID=&quot;passRec&quot; runat=&quot;server&quot;  CssClass=&quot;passRecovStyle&quot;> <InstructionTextStyle CssClass=&quot;instructionStyle&quot; /> <SuccessTextStyle CssClass=&quot;instructionStyle&quot; /> <TextBoxStyle CssClass=&quot;textboxStyle&quot; /> <TitleTextStyle CssClass=&quot;titleStyle&quot; /> <SubmitButtonStyle CssClass=&quot;buttonStyle&quot; /> <MailDefinition From=&quot;abc@abc.net&quot;  Subject=&quot;Password Recovery&quot;  /> </asp:PasswordRecovery>
CreateUserWizard Control ,[object Object],[object Object]
CreateUserWizard Control <asp:CreateUserWizard ID=&quot;createUser&quot; runat=&quot;server&quot; … > <WizardSteps> <asp:WizardStep > …  </asp:WizardStep> <asp:WizardStep > …  </asp:WizardStep>  </WizardSteps> </asp:CreateUserWizard>

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

Authentication and Authorization in Asp.Net
Authentication and Authorization in Asp.NetAuthentication and Authorization in Asp.Net
Authentication and Authorization in Asp.Net
 
Programming with Azure Active Directory
Programming with Azure Active DirectoryProgramming with Azure Active Directory
Programming with Azure Active Directory
 
Windows Azure Active Directory
Windows Azure Active DirectoryWindows Azure Active Directory
Windows Azure Active Directory
 
Zero Credential Development with Managed Identities for Azure resources
Zero Credential Development with Managed Identities for Azure resourcesZero Credential Development with Managed Identities for Azure resources
Zero Credential Development with Managed Identities for Azure resources
 
Asp.net membership anduserroles_ppt
Asp.net membership anduserroles_pptAsp.net membership anduserroles_ppt
Asp.net membership anduserroles_ppt
 
Zero Credential Development with Managed Identities
Zero Credential Development with Managed IdentitiesZero Credential Development with Managed Identities
Zero Credential Development with Managed Identities
 
Hands on with ASP.NET MVC
Hands on with ASP.NET MVC  Hands on with ASP.NET MVC
Hands on with ASP.NET MVC
 
Access Security - Privileged Identity Management
Access Security - Privileged Identity ManagementAccess Security - Privileged Identity Management
Access Security - Privileged Identity Management
 
Building a document e-signing workflow with Azure Durable Functions
Building a document e-signing workflow with Azure Durable FunctionsBuilding a document e-signing workflow with Azure Durable Functions
Building a document e-signing workflow with Azure Durable Functions
 
SAML and Liferay
SAML and LiferaySAML and Liferay
SAML and Liferay
 
Spring Security 5
Spring Security 5Spring Security 5
Spring Security 5
 
Identity Security - Azure Active Directory
Identity Security - Azure Active DirectoryIdentity Security - Azure Active Directory
Identity Security - Azure Active Directory
 
Zero credential development with managed identities
Zero credential development with managed identitiesZero credential development with managed identities
Zero credential development with managed identities
 
2009 - NRW Conf: (ASP).NET Membership
2009 - NRW Conf: (ASP).NET Membership2009 - NRW Conf: (ASP).NET Membership
2009 - NRW Conf: (ASP).NET Membership
 
AJAX Security - LAC2016
AJAX Security - LAC2016AJAX Security - LAC2016
AJAX Security - LAC2016
 
Colabora.dk - Azure PTA vs ADFS vs Desktop SSO
Colabora.dk - Azure PTA vs ADFS vs Desktop SSOColabora.dk - Azure PTA vs ADFS vs Desktop SSO
Colabora.dk - Azure PTA vs ADFS vs Desktop SSO
 
Azure Active Directory - An Introduction
Azure Active Directory  - An IntroductionAzure Active Directory  - An Introduction
Azure Active Directory - An Introduction
 
IdP, SAML, OAuth
IdP, SAML, OAuthIdP, SAML, OAuth
IdP, SAML, OAuth
 
SQL Server Security
SQL Server SecuritySQL Server Security
SQL Server Security
 
Browser Security 101
Browser Security 101 Browser Security 101
Browser Security 101
 

Andere mochten auch

Conecta con la Internet de las Cosas desde FI-WARE, mención 1
Conecta con la Internet de las Cosas desde FI-WARE, mención 1Conecta con la Internet de las Cosas desde FI-WARE, mención 1
Conecta con la Internet de las Cosas desde FI-WARE, mención 1
Fermin Galan
 
Anatomy of a digital project seminar - 20th September, London
Anatomy of a digital project seminar - 20th September, London Anatomy of a digital project seminar - 20th September, London
Anatomy of a digital project seminar - 20th September, London
Precedent
 
La muerte y_el_ajedrez_(audio)_sublime
La muerte y_el_ajedrez_(audio)_sublimeLa muerte y_el_ajedrez_(audio)_sublime
La muerte y_el_ajedrez_(audio)_sublime
aalonsog
 

Andere mochten auch (9)

sudheerinkollu.doc
sudheerinkollu.docsudheerinkollu.doc
sudheerinkollu.doc
 
Level8 Event Plans at The Grove
Level8 Event Plans at The GroveLevel8 Event Plans at The Grove
Level8 Event Plans at The Grove
 
Conecta con la Internet de las Cosas desde FI-WARE, mención 1
Conecta con la Internet de las Cosas desde FI-WARE, mención 1Conecta con la Internet de las Cosas desde FI-WARE, mención 1
Conecta con la Internet de las Cosas desde FI-WARE, mención 1
 
Acoustic Products Manufacturer & Acoustic Solutions in Hamburg Germany
Acoustic Products Manufacturer & Acoustic Solutions in Hamburg GermanyAcoustic Products Manufacturer & Acoustic Solutions in Hamburg Germany
Acoustic Products Manufacturer & Acoustic Solutions in Hamburg Germany
 
Presentation Cowallonia Lisa Lombardi 21.01.16
Presentation Cowallonia Lisa Lombardi 21.01.16Presentation Cowallonia Lisa Lombardi 21.01.16
Presentation Cowallonia Lisa Lombardi 21.01.16
 
Anatomy of a digital project seminar - 20th September, London
Anatomy of a digital project seminar - 20th September, London Anatomy of a digital project seminar - 20th September, London
Anatomy of a digital project seminar - 20th September, London
 
La muerte y_el_ajedrez_(audio)_sublime
La muerte y_el_ajedrez_(audio)_sublimeLa muerte y_el_ajedrez_(audio)_sublime
La muerte y_el_ajedrez_(audio)_sublime
 
Crisis migratoria en europa
Crisis migratoria en europaCrisis migratoria en europa
Crisis migratoria en europa
 
Training Toolkit: Peer Manager
Training Toolkit: Peer ManagerTraining Toolkit: Peer Manager
Training Toolkit: Peer Manager
 

Ähnlich wie ASP.NET 13 - Security

CTU June 2011 - Windows Azure App Fabric
CTU June 2011 - Windows Azure App FabricCTU June 2011 - Windows Azure App Fabric
CTU June 2011 - Windows Azure App Fabric
Spiffy
 
Authentication Models
Authentication ModelsAuthentication Models
Authentication Models
Raj Chanchal
 
08 asp.net session11
08 asp.net session1108 asp.net session11
08 asp.net session11
Niit Care
 
Asp interview Question and Answer
Asp interview Question and Answer Asp interview Question and Answer
Asp interview Question and Answer
home
 
Novell® iChain® 2.3
Novell® iChain® 2.3Novell® iChain® 2.3
Novell® iChain® 2.3
webhostingguy
 
Authorization in asp
Authorization in aspAuthorization in asp
Authorization in asp
OPENLANE
 

Ähnlich wie ASP.NET 13 - Security (20)

CTU June 2011 - Windows Azure App Fabric
CTU June 2011 - Windows Azure App FabricCTU June 2011 - Windows Azure App Fabric
CTU June 2011 - Windows Azure App Fabric
 
O auth2 with angular js
O auth2 with angular jsO auth2 with angular js
O auth2 with angular js
 
Authentication Models
Authentication ModelsAuthentication Models
Authentication Models
 
08 asp.net session11
08 asp.net session1108 asp.net session11
08 asp.net session11
 
Spring security jwt tutorial toptal
Spring security jwt tutorial   toptalSpring security jwt tutorial   toptal
Spring security jwt tutorial toptal
 
Owasp web security
Owasp web securityOwasp web security
Owasp web security
 
Asp interview Question and Answer
Asp interview Question and Answer Asp interview Question and Answer
Asp interview Question and Answer
 
Security asp.net application
Security asp.net applicationSecurity asp.net application
Security asp.net application
 
SharePoint 2010 Extranets and Authentication: How will SharePoint 2010 connec...
SharePoint 2010 Extranets and Authentication: How will SharePoint 2010 connec...SharePoint 2010 Extranets and Authentication: How will SharePoint 2010 connec...
SharePoint 2010 Extranets and Authentication: How will SharePoint 2010 connec...
 
Securing RESTful API
Securing RESTful APISecuring RESTful API
Securing RESTful API
 
Web security
Web securityWeb security
Web security
 
Azure AD - Password attacks - logging and protections
Azure AD - Password attacks - logging and protectionsAzure AD - Password attacks - logging and protections
Azure AD - Password attacks - logging and protections
 
Top 10 Web App Security Risks
Top 10 Web App Security RisksTop 10 Web App Security Risks
Top 10 Web App Security Risks
 
Bh Win 03 Rileybollefer
Bh Win 03 RileybolleferBh Win 03 Rileybollefer
Bh Win 03 Rileybollefer
 
Asp
AspAsp
Asp
 
Novell® iChain® 2.3
Novell® iChain® 2.3Novell® iChain® 2.3
Novell® iChain® 2.3
 
Authorization in asp
Authorization in aspAuthorization in asp
Authorization in asp
 
Rest API Security - A quick understanding of Rest API Security
Rest API Security - A quick understanding of Rest API SecurityRest API Security - A quick understanding of Rest API Security
Rest API Security - A quick understanding of Rest API Security
 
2310 b 16
2310 b 162310 b 16
2310 b 16
 
2310 b 16
2310 b 162310 b 16
2310 b 16
 

Mehr von Randy Connolly

Citizenship: How do leaders in universities think about and experience citize...
Citizenship: How do leaders in universities think about and experience citize...Citizenship: How do leaders in universities think about and experience citize...
Citizenship: How do leaders in universities think about and experience citize...
Randy Connolly
 

Mehr von Randy Connolly (20)

Celebrating the Release of Computing Careers and Disciplines
Celebrating the Release of Computing Careers and DisciplinesCelebrating the Release of Computing Careers and Disciplines
Celebrating the Release of Computing Careers and Disciplines
 
Public Computing Intellectuals in the Age of AI Crisis
Public Computing Intellectuals in the Age of AI CrisisPublic Computing Intellectuals in the Age of AI Crisis
Public Computing Intellectuals in the Age of AI Crisis
 
Why Computing Belongs Within the Social Sciences
Why Computing Belongs Within the Social SciencesWhy Computing Belongs Within the Social Sciences
Why Computing Belongs Within the Social Sciences
 
Ten-Year Anniversary of our CIS Degree
Ten-Year Anniversary of our CIS DegreeTen-Year Anniversary of our CIS Degree
Ten-Year Anniversary of our CIS Degree
 
Careers in Computing (2019 Edition)
Careers in Computing (2019 Edition)Careers in Computing (2019 Edition)
Careers in Computing (2019 Edition)
 
Facing Backwards While Stumbling Forwards: The Future of Teaching Web Develop...
Facing Backwards While Stumbling Forwards: The Future of Teaching Web Develop...Facing Backwards While Stumbling Forwards: The Future of Teaching Web Develop...
Facing Backwards While Stumbling Forwards: The Future of Teaching Web Develop...
 
Where is the Internet? (2019 Edition)
Where is the Internet? (2019 Edition)Where is the Internet? (2019 Edition)
Where is the Internet? (2019 Edition)
 
Modern Web Development (2018)
Modern Web Development (2018)Modern Web Development (2018)
Modern Web Development (2018)
 
Helping Prospective Students Understand the Computing Disciplines
Helping Prospective Students Understand the Computing DisciplinesHelping Prospective Students Understand the Computing Disciplines
Helping Prospective Students Understand the Computing Disciplines
 
Constructing a Web Development Textbook
Constructing a Web Development TextbookConstructing a Web Development Textbook
Constructing a Web Development Textbook
 
Web Development for Managers
Web Development for ManagersWeb Development for Managers
Web Development for Managers
 
Disrupting the Discourse of the "Digital Disruption of _____"
Disrupting the Discourse of the "Digital Disruption of _____"Disrupting the Discourse of the "Digital Disruption of _____"
Disrupting the Discourse of the "Digital Disruption of _____"
 
17 Ways to Fail Your Courses
17 Ways to Fail Your Courses17 Ways to Fail Your Courses
17 Ways to Fail Your Courses
 
Red Fish Blue Fish: Reexamining Student Understanding of the Computing Discip...
Red Fish Blue Fish: Reexamining Student Understanding of the Computing Discip...Red Fish Blue Fish: Reexamining Student Understanding of the Computing Discip...
Red Fish Blue Fish: Reexamining Student Understanding of the Computing Discip...
 
Constructing and revising a web development textbook
Constructing and revising a web development textbookConstructing and revising a web development textbook
Constructing and revising a web development textbook
 
Computing is Not a Rock Band: Student Understanding of the Computing Disciplines
Computing is Not a Rock Band: Student Understanding of the Computing DisciplinesComputing is Not a Rock Band: Student Understanding of the Computing Disciplines
Computing is Not a Rock Band: Student Understanding of the Computing Disciplines
 
Citizenship: How do leaders in universities think about and experience citize...
Citizenship: How do leaders in universities think about and experience citize...Citizenship: How do leaders in universities think about and experience citize...
Citizenship: How do leaders in universities think about and experience citize...
 
Thinking About Technology
Thinking About TechnologyThinking About Technology
Thinking About Technology
 
A longitudinal examination of SIGITE conference submission data
A longitudinal examination of SIGITE conference submission dataA longitudinal examination of SIGITE conference submission data
A longitudinal examination of SIGITE conference submission data
 
Web Security
Web SecurityWeb Security
Web Security
 

Kürzlich hochgeladen

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Kürzlich hochgeladen (20)

Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 

ASP.NET 13 - Security

  • 1. Chapter 13 Security, Membership, and Role Management If thou be’st not immortal, look about you: security gives way to conspiracy. The mighty gods defend thee! William Shakespeare, Julius Caesar, Act II, Scene 3
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17. Trust Levels No capability to interact with resources. Intended for sites with little dynamic content. Minimal Models a read-only application because no network access to other servers is allowed. Low Permissions are limited to what the application can access in its own folder structure. Thus, although a medium trust application can access a SQL Server database, it cannot access files or folders outside its own virtual directory hierarchy. As well, it has no reflection permissions, so those applications that require reflection (such as the typical object/relational mapper) may not work. Intended to be used for hosting environments that contain multiple customers’ sites. Medium Code can use most of the .NET Framework. The limitations are no unmanaged code, no enterprise services, and limited use of reflection. High The application is fully trusted. All .NET code is allowed to run and thus any .NET classes can be used (however, still subject to operating system and Windows ACL limitations). This is the default. Full Description Trust Name
  • 18.
  • 19.
  • 20. Forms Authentication <system.web> … <authentication mode=&quot;Forms&quot; > <forms loginUrl=&quot;Login.aspx&quot; /> </authentication> <authorization> <deny users=&quot;?&quot;/> </authorization> </system.web>
  • 21.
  • 22.
  • 23.
  • 24.
  • 25. How does it work?
  • 26.
  • 27.
  • 28.
  • 30.
  • 31. Provider-based Services Manages the special set of controls for creating Web sites that enable end users to modify the content, appearance, and behavior of Web pages directly within the browser. Web Parts Used by ASP.NET health monitoring subsystem that allows the monitoring of a Web application. Web events Provides a description of a site’s structure. Site map Maintains user state between requests. Session state Handles role-based security. Role management Manages user preferences and user information across visits. Profile Manages user accounts. Membership Handles encryption and decryption of sections of the ASP.NET configuration files. Encryption Description Service
  • 33.
  • 34.
  • 35. WAT
  • 36.
  • 37. Membership Class Returns true if the specified user name and password are valid (i.e., exist in the data store). ValidateUser Updates the data source with the information contained in the specified MembershipUser object. UpdateUser Returns the user name for the specified email. GetUserNameByEmail Returns a MembershipUser object for the current logged on user. GetUser Gets the number of users that is currently accessing the application. GetNumberOfUsersOnline Returns a MembershipUserCollection of all users. GetAllUsers Generates a random password of the specified length. GeneratePassword Returns a MembershipUserCollection of users whose user name matches the passed user name. FindUsersByName Returns a MembershipUserCollection of users whose email matches the passed email. FindUsersByEmail Deletes an existing user from the membership data store. DeleteUser Adds a new user to the membership data store. CreateUser Description Name
  • 38.
  • 39.
  • 40. Login Controls Allows user passwords to be retrieved and sent to the email for that account. PasswordRecovery Displays one of two possible interfaces: one for authenticated users and one for anonymous users. LoginView Displays a login link for nonauthenticated users and a logout link for authenticated users. LoginStatus Displays the name of the authenticated user. LoginName Displays a customizable user interface for gathering user credentials. Login Based on the Wizard control covered in Chapter 4. A multistep process for gathering the user name, password, email address, and password question and answer. CreateUserWizard Lets users change their password. ChangePassword Description Name
  • 41. Login Control <asp:Login ID=&quot;logSignin2&quot; runat=&quot;server&quot; TextLayout=&quot;TextOnTop&quot; CssClass=&quot;loginStyle&quot;> <TitleTextStyle CssClass=&quot;loginTitle&quot; /> <InstructionTextStyle Font-Italic=&quot;True&quot; ForeColor=&quot;Black&quot; /> <TextBoxStyle Font-Size=&quot;0.8em&quot; /> <LoginButtonStyle CssClass=&quot;buttonStyle&quot; /> </asp:Login>
  • 42.
  • 43. LoginName and LoginStatus Controls <asp:LoginName ID=&quot;logName&quot; runat=&quot;server&quot; FormatString=&quot;Welcome {0}&quot; /> <asp:LoginStatus ID=&quot;logStat&quot; runat=&quot;server&quot; LoginImageUrl=&quot;images/btn_login.gif&quot; LogoutImageUrl=&quot;images/btn_logout.gif&quot; LogoutAction=&quot;Refresh&quot; />
  • 44.
  • 45. LoginView Controls <asp:LoginView ID=&quot;logView&quot; runat=&quot;server&quot;> <AnonymousTemplate> <strong>For more features</strong><br /> <asp:LoginStatus ID=&quot;logStat&quot; runat=&quot;server&quot; LoginImageUrl=&quot;images/btn_login.gif&quot; LogoutImageUrl=&quot;images/btn_logout.gif&quot; LogoutAction=&quot;Refresh&quot; /> </AnonymousTemplate> <LoggedInTemplate> <strong>Rate this book</strong><br /> <asp:RadioButtonList ID=&quot;radList&quot; runat=&quot;server&quot;> <asp:ListItem Selected=&quot;true&quot;> No Rating</asp:ListItem> <asp:ListItem> <img src='images/stars1.gif'/></asp:ListItem> <asp:ListItem> <img src='images/stars2.gif'/></asp:ListItem> <asp:ListItem> <img src='images/stars3.gif'/></asp:ListItem> <asp:ListItem> <img src='images/stars4.gif'/></asp:ListItem> <asp:ListItem> <img src='images/stars5.gif'/></asp:ListItem> </asp:RadioButtonList> <asp:Button ID=&quot;btnRate&quot; runat=&quot;server&quot; Text=&quot;Rate Book&quot; /> </LoggedInTemplate> </asp:LoginView>
  • 46.
  • 47. ChangePassword <asp:ChangePassword ID=&quot;chngPass&quot; runat=&quot;server&quot; CssClass=&quot;passChangeStyle&quot; > <CancelButtonStyle CssClass=&quot;buttonStyle&quot; /> <ChangePasswordButtonStyle CssClass=&quot;buttonStyle&quot; /> <ContinueButtonStyle CssClass=&quot;buttonStyle&quot; /> <TitleTextStyle CssClass=&quot;titleStyle&quot; /> <TextBoxStyle CssClass=&quot;textboxStyle&quot; /> </asp:ChangePassword>
  • 48.
  • 49. PasswordRecovery <asp:PasswordRecovery ID=&quot;passRec&quot; runat=&quot;server&quot; CssClass=&quot;passRecovStyle&quot;> <InstructionTextStyle CssClass=&quot;instructionStyle&quot; /> <SuccessTextStyle CssClass=&quot;instructionStyle&quot; /> <TextBoxStyle CssClass=&quot;textboxStyle&quot; /> <TitleTextStyle CssClass=&quot;titleStyle&quot; /> <SubmitButtonStyle CssClass=&quot;buttonStyle&quot; /> <MailDefinition From=&quot;abc@abc.net&quot; Subject=&quot;Password Recovery&quot; /> </asp:PasswordRecovery>
  • 50.
  • 51. CreateUserWizard Control <asp:CreateUserWizard ID=&quot;createUser&quot; runat=&quot;server&quot; … > <WizardSteps> <asp:WizardStep > … </asp:WizardStep> <asp:WizardStep > … </asp:WizardStep> </WizardSteps> </asp:CreateUserWizard>