Managing Identity and Permissions

Slides:



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

Module 6: Configuring Windows XP Professional to Operate in a Microsoft Network.
Implementing and Administering AD FS
SharePoint 2010 Permissions Keith Tuomi. profile KEITH TUOMI SharePoint Consultant / Developer at itgroove Developing Online Systems since years.
SharePoint 2010 Business Productivity: What's new for Developers in Microsoft SharePoint 2010 Matthew McDermott, MVP Aptillon, Able Blue
Microsoft ASP.NET Security Venkat Chilakala Support Professional Microsoft Corporation.
ASP.NET 2.0 Chapter 6 Securing the ASP.NET Application.
Microsoft ® Official Course Interacting with the Search Service Microsoft SharePoint 2013 SharePoint Practice.
Microsoft SharePoint 2013 SharePoint 2013 as a Developer Platform
Microsoft ® Official Course Developing Remote-hosted Apps for SharePoint Microsoft SharePoint 2013 SharePoint Practice.
Microsoft ® Official Course Introducing Apps for SharePoint SharePoint Practice Microsoft SharePoint 2013.
Configuring and Troubleshooting Identity and Access Solutions with Windows Server® 2008 Active Directory®
Mark Kashman Senior Product Manager –
Microsoft ® Official Course Monitoring and Troubleshooting Custom SharePoint Solutions SharePoint Practice Microsoft SharePoint 2013.
Share easilyShare responsibly Share with anyone.
Managing Client Access
Module 4 Managing Client Access. Module Overview Configuring the Client Access Server Role Configuring Client Access Services for Outlook Clients Configuring.
Delivering Excellence in Software Engineering ® EPAM Systems. All rights reserved. ASP.NET Authentication.
1 ASP.NET SECURITY Presenter: Van Nguyen. 2 Introduction Security is an integral part of any Web-based application. Understanding ASP.NET security will.
Edwin Sarmiento Microsoft MVP – Windows Server System Senior Systems Engineer/Database Administrator Fujitsu Asia Pte Ltd
Working with Workgroups and Domains
Overview of Access and Information Protection
Implementing Secure Shared File Access
First Look Clinic: What’s New for IT Professionals in Microsoft® SharePoint® Server 2013 Sayed Ali (MCTS, MCITP, MCT, MCSA, MCSE )
Session 11: Security with ASP.NET
Forms Authentication, Users, Roles, Membership Svetlin Nakov Telerik Corporation
Christopher Chapman | MCT Content PM, Microsoft Learning, PDG Planning, Microsoft.
Module 8 Configuring and Securing SharePoint Services and Service Applications.
Managing Active Directory Domain Services Objects
Configuring and Troubleshooting Identity and Access Solutions with Windows Server® 2008 Active Directory®
Module 10: Configuring Windows XP Professional to Operate in Microsoft Networks.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 Securing a Microsoft ASP.NET Web Application.
Module 9 Configuring Messaging Policy and Compliance.
20411B 8: Installing, Configuring, and Troubleshooting the Network Policy Server Role Presentation: 60 minutes Lab: 60 minutes After completing this module,
Module 9 Authenticating and Authorizing Users. Module Overview Authenticating Connections to SQL Server Authorizing Logins to Access Databases Authorization.
Module 5 Configuring Authentication. Module Overview Lesson 1: Understanding Classic SharePoint Authentication Providers Lesson 2: Understanding Federated.
Microsoft ® Official Course Module 3 Managing Active Directory Domain Services Objects.
SharePoint Security Fundamentals Introduction to Claims-based Security Configuring Claims-based Security Development Opportunities.
External user invited This creates invitation in Access Request List Invitation sent to guest with invitation URL Guest clicks URL. Verification.
HOW SHAREPOINT WORKS By Gary Newman. Root Folder Virtual Directories SP Farm DNS Iterative Forward DNS query for A host record HTTP request HTML & JS.
Module 9 Configuring Messaging Policy and Compliance.
Dr. Mustafa Cem Kasapbaşı Security in ASP.NET. Determining Security Requirements Restricted File Types.
Module 13 Implementing Business Continuity. Module Overview Protecting and Recovering Content Working with Backup and Restore for Disaster Recovery Implementing.
Module 11: Securing a Microsoft ASP.NET Web Application.
Module 6 Securing Content. Module Overview Administering SharePoint Groups Implementing SharePoint Roles and Role Assignments Securing and Auditing SharePoint.
Module 3: Managing a Microsoft ® Windows ® Small Business Server Environment.
Working with Workgroups and Domains Lesson 9. Objectives Understand users and groups Create and manage local users and groups Understand the difference.
Module 7 Planning and Deploying Messaging Compliance.
Claims-Based Identity Solution Architect Briefing zoli.herczeg.ro Taken from David Chappel’s work at TechEd Berlin 2009.
Module 4 Planning for Group Policy. Module Overview Planning Group Policy Application Planning Group Policy Processing Planning the Management of Group.
MEMBERSHIP AND IDENTITY Active server pages (ASP.NET) 1 Chapter-4.
Inventory & Monitoring Program SharePoint Permissions Who has access? What can they do with the access? What is the easiest way to manage the permissions?
Copyright © 2006 Pilothouse Consulting Inc. All rights reserved. Security Overview Functional security – users, groups, and permissions for sites, lists,
Configuring and Troubleshooting Identity and Access Solutions with Windows Server® 2008 Active Directory®
Microsoft ® Official Course Structuring and Publishing Websites for All Users Microsoft SharePoint 2013 SharePoint Practice.
Module 9 User Profiles and Social Networking. Module Overview Configuring User Profiles Implementing SharePoint 2010 Social Networking Features.
Module 11: Designing an Active Directory Federation Services Implementation in Windows Server 2008.
Security E-Learning Chapter 08. Security Control access to your web site –3 Techinques for Identifying users Giving users access to your site Securing.
Module 1: Overview of Microsoft Office SharePoint Server 2007.
Microsoft ® Official Course Designing and Managing Features and Solutions Microsoft SharePoint 2013 SharePoint Practice.
Microsoft ® Official Course Implementing Enterprise Content Management Microsoft SharePoint 2013 SharePoint Practice.
Configuring and Deploying Web Applications Lesson 7.
Module 6: Configuring User Environments Using Group Policies.
Securing Web Applications Lesson 4B / Slide 1 of 34 J2EE Web Components Pre-assessment Questions 1. Identify the correct return type returned by the doStartTag()
Microsoft ® Official Course Module 9 Working with Business Connectivity Services.
Permission Management in SharePoint – Overview and best practices Toni Frankola Co-Founder & CEO, Acceleratio Ltd., Croatia.
SharePoint Authentication and Authorization
Deep Dive into SharePoint 2010 Security
Stop Those Prying Eyes Getting to Your Data
Jim Fawcett CSE686 – Internet Programming Summer 2005
Presentation transcript:

Managing Identity and Permissions 20488B 6: Managing Identity and Permissions Microsoft SharePoint 2013   Managing Identity and Permissions SharePoint Practice

Customizing the Authentication Experience 20488B Module Overview 6: Managing Identity and Permissions Customizing the Authentication Experience  

Lesson 1: Understanding Identity Management in SharePoint 2013 20488B Lesson 1: Understanding Identity Management in SharePoint 2013 6: Managing Identity and Permissions Discussion: Scenarios for Impersonation  

Authentication in SharePoint 20488B Authentication in SharePoint 6: Managing Identity and Permissions SharePoint uses external authentication providers. Classic-Mode Authentication Claims-Mode Authentication: Use the graphic on the slide to illustrate the SharePoint components, and external components, that are involved in authentication. Claims Providers Claims-Based Application Claims Issuer AD DS SharePoint Web Application Security Token Service ASP.NET FBA AD FS 1. User obtains token 2. User sends token to SharePoint Custom Claims Provider

Authentication Types and Methods 20488B Authentication Types and Methods 6: Managing Identity and Permissions Windows Authentication Only supported by Internet Explorer Requires an AD DS user account Authentication methods include Kerberos, NTLM, and Basic FBA Authentication Uses ASP.NET membership providers for authentication Uses ASP.NET role provider for group membership Many providers available SAML Authentication Supports federated authentication providers such as AD FS This topic includes three additional slides, which you can use to illustrate each authentication type and describe how they execute step-by-step. When you use these slides, remember to emphasize the differences between authentication types.

Windows Authentication 20488B Windows Authentication 6: Managing Identity and Permissions Anonymous request SharePoint requests token Credentials sent Credentials forwarded to AD DS Security groups obtained Claims token created and returned Token sent to SharePoint Use this additional slide to describe and illustrate the Windows Authentication mechanism. SharePoint Web Application User

Forms-Based Authentication 6: Managing Identity and Permissions Anonymous request SharePoint redirects user to logon page Authentication form submitted Credentials forwarded to ASP.NET membership provider Roles obtained from ASP.NET roles provider Claims token created and returned Token sent to SharePoint Use this additional slide to describe and illustrate the FBA mechanism. Membership Provider Roles Provider 4 5 SharePoint STS 6 3 User SharePoint Web Application 2 1

SharePoint Web Application SAML Authentication 6: Managing Identity and Permissions Anonymous request SharePoint redirects user User submits credentials Credentials validated against remote authentication provider SAML token returned to user User requests resource with token STS uses SAML token to create claims token Claims used for authentication Use this additional slide to describe and illustrate the SAML authentication mechanism. User SharePoint Web Application 2 1, 6

How SharePoint Represents Users 20488B How SharePoint Represents Users 6: Managing Identity and Permissions SPUser SPGroup SPPrincipal   SPUser user = SPContext.Current.Web.CurrentUser; SPUserCollection users = SPContext.Current.Web.AllUsers;

Impersonation Using Elevated Privileges Impersonating a Specific User 20488B Impersonation 6: Managing Identity and Permissions Using Elevated Privileges Impersonating a Specific User SPSecurity.RunWithElevatedPrivileges(delegate () { using (SPSite site = new SPSite("http://site") { //Execute operations here } }); Emphasize that impersonation should be used only when it is absolutely necessary and then with great care. It is the developer's responsibility to ensure that impersonation does not result in any compromise to the security infrastructure within SharePoint, Windows, or any associated system. Since impersonation can circumvent permission levels assigned by administrators, developers must check all user input thoroughly and ensure that no security compromises arise. If developers cannot be completely confident that impersonation can be used without damaging security, they should not use it. using (SPSite site = new SPSite(SPContext.Current.Site.Url, accessToken)) { //Operations executed in this using block have the //permissions of the SpecialAccess account }

Discussion: Scenarios for Impersonation 20488B Discussion: Scenarios for Impersonation 6: Managing Identity and Permissions Discuss the following scenarios: Setup Code in a Farm Solution Setting Permissions in a SharePoint List Recording Approvals Make sure that the students read each scenario in full from the student notebook before beginning each discussion. The following notes may help your discussion: Setup Code in a Farm Solution Usually, when a SharePoint user installs a SharePoint farm solution, their user account is the owner of any lists the solution creates. As the owner of the list, the user can assign full control permission. To avoid this, you can use RunWithElevatedPrivileges in the feature receiver to create the list. This ensures that the list owner is the SharePoint system, not any user account. In this way you can ensure that no SharePoint user accounts can have full control over the list. Setting Permissions in a SharePoint List This scenario does not require impersonation. Instead, either manually or in code, assign full control permission to the HR managers group or role. This ensures that HR managers can assign permissions to other users. Recording Approvals In most cases, when a user modifies any item in a SharePoint list or library, other users can see who modified the item. This is important for auditing changes. In this case, you can create a dedicated SharePoint user account and grant permission to the documents list. In the approval code, obtain the user token for this account and use it to impersonate the account as the approval is made. Authors will see only that the dedicated account made the approval, not the name of the editor who reviewed their work.

Lesson 2: Managing Permissions in SharePoint 2013 20488B Lesson 2: Managing Permissions in SharePoint 2013 6: Managing Identity and Permissions Managing Access to Resources  

SPSecurableObject represents a list, library, website or item Permissions Classes 6: Managing Identity and Permissions SPSecurableObject represents a list, library, website or item SPRoleDefinition represents a permissions level SPRoleAssignment represents the assignment of a permission level to a security principal such as a user or group SPRoleDefinitionBinding defines the role definitions bound to a role assignment object Ensure that students are clear on the difference between a base permission and a permission level, which is also called a role definition.

20488B Checking Permissions 6: Managing Identity and Permissions if (website.DoesUserHavePermissions(user.LoginName, SPBasePermissions.EditListItems)) { //User can edit items in lists editButton.Visible = true; } else //User cannot edit items in lists editButton.Visible = false;  

Assigning Permissions 20488B Assigning Permissions 6: Managing Identity and Permissions Assigning a Permissions Level Create a new SPRoleAssignment Add a role definition binding to the assignment Add the assignment to the RoleAssignments collection on the securable object Creating a Custom Permissions Level Create a new SPRoleDefinition Add permissions to the BasePermissions collection Add the role definition to the RoleDefinitions collection on the website  

Managing Access to Resources 20488B Managing Access to Resources 6: Managing Identity and Permissions Permissions Inheritance Breaking inheritance Restoring inheritance Anonymous Access Enabling anonymous users to access a site Assigning permissions to anonymous users Emphasize that simple permissions levels assigned at the site level tend to result in fewer support calls, because it is easy for users to understand the level of access they expect to receive. Such permission levels also make it easier for administrators to troubleshoot incorrect permissions, because there is only one object where permissions levels are applied. If developers do need to break inheritance and assign permissions to multiple, lower level objects, they should document their permissions levels carefully to ease diagnosis.

Lab A: Managing Permissions Programmatically in SharePoint 2013 6: Managing Identity and Permissions Exercise 1: Managing List Permissions Programmatically Exercise 1: Managing List Permissions Programmatically A colleague has created a new SharePoint project in Visual Studio and added the Financials document library to the project. You have been asked to add code to this project that ensures that only site owners and members of the Managers group can access documents in the Financials library when the solution is deployed to any SharePoint site.

20488B Lab Scenario 6: Managing Identity and Permissions Contoso plan to add a document library named Financials to every project site on the company intranet portal. Because this document library will contain sensitive financial data, you must restrict who can access the library. Only the site owners group of each project site, together with the members of the Managers security group, should be able to view documents in the Financials library

20488B Lab Review 6: Managing Identity and Permissions In Task 4, you granted Contribute permissions to members of the Managers AD DS security group. What other method could you use to grant this permission when permission inheritance is enabled? Question In the Task 2, when you called the BreakRoleInheritance method, you passed the value false. What would happen if you passed the value true instead? Answer If you passed the value true, role inheritance is broken, but the initial permissions for the library are copied from the parent site. In Task 4, you granted Contribute permissions to members of the Managers AD DS security group. What other method could you use to grant this permission when permission inheritance is enabled? You could add the Managers security group to the Site Members SharePoint group, which has the Contribute permission level by default.

Lesson 3: Configuring Forms-Based Authentication 6: Managing Identity and Permissions Discussion: Federation and Custom Provider Scenarios  

Forms-Based Authentication Overview 6: Managing Identity and Permissions Architecture Membership Providers Role Providers Credential Stores Advantages and Disadvantages  

Creating Custom Membership Providers 6: Managing Identity and Permissions To create a custom membership provider: Inherit the System.Web.Security.MembershipProvider class Override the following methods: GetUser FindUsersByEmail FindUsersByName GetAllUsers ValidateUser  

Creating Custom Role Providers 20488B Creating Custom Role Providers 6: Managing Identity and Permissions To create a custom role provider: Inherit the System.Web.Security.RoleProvider class Override the following methods: GetRolesForUser RoleExists  

Registering Providers 20488B Registering Providers 6: Managing Identity and Permissions To use a custom membership provider or role provider: Deploy the provider Create a new web application and configure it to use the provider Configure the web.config files for: The Central Administration site The Secure Token Server The new web application  

Creating a Custom Login Page 20488B Creating a Custom Login Page 6: Managing Identity and Permissions To create a custom login page for FBA: Create a new empty SharePoint project. Add a new application page to the project. Add references to Microsoft.SharePoint.Security.dll and Microsoft.SharePoint.IdentityModel.dll Use the SPClaimsUtility.AuthenticateFormsUser method to log the user in. Package and deploy the solution. In Central Administration, configure a web application to use the new login page.  

Discussion: Federation and Custom Provider Scenarios 20488B Discussion: Federation and Custom Provider Scenarios 6: Managing Identity and Permissions Scenario: A Custom Credential Store Read the scenario and then discuss the following questions: Can user accounts in the custom directory system be used to access SharePoint without migrating them into AD DS? Can forms authentication be used to check credentials that are stored in the custom directory system? Can federated SAML authentication be used to check credentials that are stored in the custom directory system? Ensure that all students read the scenario before discussing the questions. This scenario is designed to provoke a discussion rather than to dictate correct answers. Use the following points to guide your discussion: Can user accounts in the custom directory system be used to access SharePoint without migrating them into AD DS? If you can write .NET managed code that can access the accounts in the directory system, then SharePoint can authenticate accounts. For example, you could create a custom FBA authentication provider that calls the custom directory to authenticate credentials. Can forms authentication be used to check credentials that are stored in the custom directory system? Again, is .NET managed code can call the directory service, this is possible. Can federated SAML authentication be used to check credentials that are stored in the custom directory system? Since the directory service is not standards-compliant, it seems unlikely that a federated authentication provider, such as AD FS, could trust the custom directory service.

Lesson 4: Customizing the Authentication Experience 20488B Lesson 4: Customizing the Authentication Experience 6: Managing Identity and Permissions Demonstration: A Custom Claims Provider  

What is a Claims Provider? 20488B What is a Claims Provider? 6: Managing Identity and Permissions A claims provider is a component that formulates the claims that SharePoint incorporates into the user’s security token at authentication. SharePoint uses claims to: Authorize access to resources. Help users to pick from a list of their fellow users. Make sure that students do not confuse claims providers with FBA membership providers or FBA role providers.

Creating a Claims Provider 20488B Creating a Claims Provider 6: Managing Identity and Permissions To create a custom claims provider, derive from SPClaimProvider and implement: SupportsEntityInformation FillClaimsForEntity() FillSchema FillClaimTypes FillClaimValueTypes FillEntityTypes  

Deploying a Claims Provider 20488B Deploying a Claims Provider 6: Managing Identity and Permissions To deploy a claims provider, create a feature receiver: Derive the feature receiver from the SPClaimProviderFeatureRecieverClass Override the following properties ClaimProviderAssembly ClaimProviderType ClaimProviderDisplayName ClaimProviderDescription  

Demonstration: A Custom Claims Provider 20488B Demonstration: A Custom Claims Provider 6: Managing Identity and Permissions In this demonstration, you will see when the following two methods execute in a Custom Claims Provider: FillClaimsForEntity() FillSearch() You will code these methods in the lab. The following lab is involved and can confuse students. Use this demonstration to illustrate when methods in the claims provider execute and explain the purpose of each method. This will help to orientate students as they complete the lab. Preparation Steps You may want to start the virtual machine in advance to save time during the demonstration. Demonstration Steps Start the 20488B-LON-SP-06 virtual machine. Log on to the LONDON machine as CONTOSO\Administrator with the password Pa$$w0rd. On the Windows Start screen, click Computer. Browse to E:\LabFiles\LabB\Solution\ContosoClaimsProvider folder. Double-click ContosoClaimsProvider.sln. In the How do you want to open this type of file (.sln)? dialog box, click Visual Studio 2012.In the Solution Explorer, double-click ContosoClaimsProvider.cs. In the ContosoClaimsProvider.cs code file, locate the following line of code: protected override void FillClaimsForEntity(Uri context, SPClaimEntity entity, List<SPClaim> claims) Right-click the located code, click Breakpoint, and then click Insert breakpoint. Locate the following line of code: protected override void FillSearch(Uri context, string[] entityTypes, string searchPattern, string hierarchyNodeID, int maxCount, SPProviderHierarchyTree searchTree) Right-click the located code, click Breakpoint, and then click Insert breakpoint.In the Windows Start page, click SharePoint 2013 Management Shell. Type IISReset and then press Enter.In Visual Studio, on the DEBUG menu, click Start Debugging. (More notes on the next slide)

Demonstration: A Custom Claims Provider 20488B Demonstration: A Custom Claims Provider 6: Managing Identity and Permissions If a Debugging Not Enabled dialog box appears, click OK. Before you log on to SharePoint, switch to Visual Studio. On the DEBUG menu, click Attach to Process. Select the Show processes from all users checkbox. In the Available Processes list, click the w3wp.exe process with the username CONTOSO\SPFarm. Click Attach, and then in the Attach Security Warning dialog, click Attach. Switch back to Internet Explorer. In the Windows Security dialog, in the User name box, type Administrator. In the Password box, type Pa$$w0rd, and then click OK.Visual Studio interrupts execution in the FillClaimsForEntity method. Explain that this method executes whenever a user authenticates with SharePoint and adds claims to the user token. On the DEBUG menu, click Continue.In Internet Explorer, click the Settings icon, and then click Site settings. Under Users and Permissions, click Site permissions. Click Contoso Development Site Visitors. Click New. In the Add people to the Contoso Development Site Visitors group box, type North. Visual Studio interrupts execution in the FillSearch method. Explain that this method executes whenever a user searches for a user or group in the People Picker control. On the DEBUG menu, click Delete All Breakpoints. In the Microsoft Visual Studio dialog box, click Yes. (More notes on the next slide)

Demonstration: A Custom Claims Provider 20488B Demonstration: A Custom Claims Provider 6: Managing Identity and Permissions On the DEBUG menu, click Continue.Click North America and then click Share. Close Internet Explorer. Close Visual Studio.

Lab B: Creating and Deploying a Custom Claims Provider 6: Managing Identity and Permissions Exercise 3: Deploying and Testing a Claims Provider Exercise 1: Creating a Custom Claims Provider In this exercise, you will create a custom claims provider and implement the code required to support claims augmentation. Exercise 2: Supporting Search and Resolve in a Claims Provider In this exercise, you will add the code necessary to support People Picker functionality, including search and resolve operations. Exercise 3: Deploying and Testing a Claims Provider In this exercise, you will create a feature and feature receiver that can deploy the Contoso location claims provider. You will also test the claims provider in the development site.

20488B Lab Scenario 6: Managing Identity and Permissions The research team at Contoso is working on some highly confidential research. The team wants to be able to restrict access to information based on where a user logs on. Your task is create a custom claims provider that augments the user's claim token with location information.

20488B Lab Review 6: Managing Identity and Permissions You want to create a claims provider that augments claims in the user's security token but does not show up in the People Picker dialog. Which methods should you implement in the SPClaimProvider class? Question Why can you not use a class that derives from SPFeatureReceiver to deploy a claims provider? Answer You must derive the feature receiver from the SPClaimProviderFeatureReceiver class in order to deploy a claims provider because specialized properties such as ClaimProviderAssembly and ClaimProviderDisplayName are not supported by SPFeatureReceiver. You want to create a claims provider that augments claims in the user's security token but does not show up in the People Picker dialog. Which methods should you implement in the SPClaimProvider class? You should implement FillClaimTypes, FillClaimValues, FillClaimsForEntity, and FillEntityTypes.

Module Review and Takeaways 20488B Module Review and Takeaways 6: Managing Identity and Permissions Best Practice Review Question(s) Question You are writing a SharePoint farm solution that must reassign permissions for the Financials library. The farm solution is deployed under the security context of your personal user account. You find that the solution is prevented from reassigning the permissions required. How can you ensure that the solution can always overcome these restrictions? Answer Use the RunWithElevatedPrivileges method to execute the code as the SharePoint system account. True or false: To enable SharePoint to authenticate user credentials against a custom user store, you must create a custom FBA role provider. ( )False ( )True (√)False Best Practice: By using custom claim providers to restrict access to resources, you can secure your SharePoint farm and comply with legislation in your legal jurisdiction without using or publishing confidential information about your users.