An overview of Claims-Based Identity in SharePoint 2010 with a discussion of issues encountered during a migration from MOSS and recommendations for new implementations. Presented by Danny Jessee at the SUGDC meeting during SPSTCDC on August 11, 2011.
1. All It “Claims” to Be? A real-world perspective on Claims-Based Identity in SharePoint 2010 Danny Jessee SharePoint User Group of Washington, DC – August 11, 2011
2. Who Am I? SharePoint Evangelist at Circinus Northern Virginia-based SDVOSB Senior developer on SharePoint deployments for government and DoD customers since 2004 I get involved with administration when I have to… MCTS – SharePoint 2010 Application Development CloudShare Honorary MVP for 2011 Twitter: @dannyjessee Blog: http://dannyjessee.com/blog
3. Agenda Features of a Secure Application SharePoint 2010 Authentication Options Claims Terminology/Technology Overview Demos SharePoint 2010 Web Application with FBA Adding Azure ACS-based Trusted Identity Providers “Gotchas” General issues for all Claims implementations Migration issues from MOSS to SharePoint 2010 Claims Behaving Badly Recommendations
4. Features of aSecure Application Authentication is the process of validating a user’s identity SharePoint never performs authentication If the login prompt keeps appearing, think authentication issue!
5. Features of aSecure Application Authorization is the process of determining the resources, features, etc. to which a user has access SPUserobject – security principal If you see “Access Denied” errors, think authorization issue!
6. Authentication Options in SharePoint 2010 The single biggest decision of your life! TechNet guidance: “For new implementations of SharePoint Server 2010, you should consider claims-based authentication.”
7. Authentication Options in SharePoint 2010 Claims Based Authentication (Tokens) Windows Authentication: NTLM/Kerberos, Basic Forms-Based Authentication (ASP.NET Membership provider and Role manager) Trusted Identity providers Custom sign-in page Classic Mode Authentication (“Old School”) Windows Authentication (NTLM/Kerberos) only Both map authenticated users to SPUser objects (security principals)
8. Claims-Based IdentityConcepts What is a claim? A piece of information describing a user Name Email Address Role/Group membership Age Hire Date Whose claims do I trust, and which claims affect authorization decisions I make?
9. Claims-Based IdentityTerminology Token Serialized set of claims about an authenticated user, digitally signed by the token’s issuer Identity Provider-Security Token Service (IP-STS) Validates user credentials Builds, signs, and issues tokens containing claims Relying party (RP) Applications that makes authorization decisions based on claims (SharePoint 2010)
10. The Claims Paradigm Decoupling of authentication logic from authorization and personalization logic Applications no longer need to determine who the user is, they receive claims identifying the user Great for developers who rarely want to work with identity! Provides a common way for applications to acquire the identity information they need about users
11. The Claims Paradigm “I’d like to access the budget document.” “Not until you can prove to me that you are in the Finance group.” “Here is my user ID and password.” “Hi, Danny. I see you are in the Finance group. Here is a token you can use.” “I’d like to access the budget document,and here’s proof I have access to it!” SharePoint 2010
12. Claims-Based IdentityTechnologies WS-Trust, WS-Federation, SAML Requesting/receiving tokens XML representation of claims These emerging technologies have been around for awhile Their use in Claims-Based Identity represents a new approach for handling identity in applications Great potential in corporate environments Active Directory Federation Services, external LDAP, etc. Great potential as we move to the cloud Azure ACS: Facebook, Google, Windows Live ID, etc.
14. Claims Viewer Web Part Visual Web Part Code behind: http://blogs.pointbridge.com/Blogs/nielsen_travis/Pages/Post.aspx?_ID=32 IClaimsPrincipalclaimsPrincipal = Page.UserasIClaimsPrincipal; IClaimsIdentityclaimsIdentity = (IClaimsIdentity) claimsPrincipal.Identity; GridView1.DataSource = claimsIdentity.Claims;Page.DataBind();
15. FBA in SharePoint 2010 Similar to FBA setup for MOSS, with some exceptions: Authentication provider does not need to be mapped to a separate zone One additional Web.config to modify: C:rogram Filesommon Filesicrosoft Sharedeb Server Extensions4ebServicesecurityToken Add entries for connection string, Membership provider, Role manager Same modifications for Central Admin and web app
16. Sign-In Page Allows users to choose how to authenticate when multiple providers are configured(Mixed Authentication) Custom code opportunity http://www.orbitone.com/en/blog/archive/2010/06/23/sharepoint-2010-mixed-authentication-automatic-login.aspx
19. Adding Facebook Support Note the App ID and App Secret values Assign a “Privacy Policy” URL Grant Permissions to generate Access Token Choose “Web” in left navigation, enter values for Site URL and Site Domain Based on your AppFabric Labs account
20. Adding Facebook Support Generate self-signed certificate C:rogram Filesicrosoft Office Servers4.0ools>MakeCert.exe -r -pe -n "CN=com-dannyjessee.accesscontrol.appfabriclabs.com" -sky exchange -ssmy Development only! Do not do in production!
22. Adding Facebook Support From Azure ACS, choose Add Identity Provider, then choose Facebook application Enter Application ID, Application secret, and Application permissions
30. Claims “Gotchas” General issues for all Claims implementations Search crawler requires NTLM in the zone it uses “People picker” is more of a Claims “expression editor” Custom code opportunity (Custom Claims Provider) User Profiles LDAP or BCS connection to authentication store Office client integration (2007 SP2+, 2010) IE 8+: Trusted Sites
31. Real-Life Testimonial “After migrating to Claims in SharePoint 2010, most of our users were able to log in some of the time.” —A less-than-thrilled system administrator
32. Claims “Gotchas” Migration from MOSS to SharePoint 2010 Migrate FBA Users $wa = get-SPWebApplication $WebAppName $wa.MigrateUsers($true) Portalsuperuser and Portalsuperreader properties need to be updated to reflect Claims-encoded format $wa.Properties["portalsuperuseraccount"] = "i:0#.w|domainpppool" $wa.Properties["portalsuperreaderaccount"] = "i:0#.w|domainpppool" $wa.Update() Must migrate all providers from MOSS to 2010 i.e., NTLM and FBA if both existed prior to migration
34. Claims Behaving Badly Set DisplayNameproperty of SPUser $user = Get-SPUser -Web http://abc.shrpnt.loc -Identity "i:0#.f|CustomMembershipProvider|username" $user.DisplayName = "John Doe" $user.Update()
35. Claims Behaving Badly Session expiration issues with SAML Claims Users can come back to the page hours later without having to log in again SharePoint creates a FedAuth cookie (written to disk) that is not a Session cookie by default $sts = Get-SPSecurityTokenServiceConfig $sts.UseSessionCookies= $true $sts.Update() Set/update TokenLifetimeproperty (minutes) Set-ADFSRelyingPartyTrust -TargetName "SPS 2010 ADFS" -TokenLifetime 5
36. Claims Behaving Badly Continuous redirection to/from login page This can happen when the TokenLifetimeis less than the LogonTokenCacheExpirationWindow Default LogonTokenCacheExpirationWindowin SharePoint 2010 STS is 10 minutes $sts = Get-SPSecurityTokenServiceConfig $sts.LogonTokenCacheExpirationWindow =(New-TimeSpan -minutes 4) $sts.Update()
37. Claims Behaving Badly Go to the login page, enter valid credentials, press the “Log In” button, and…get redirected back to the login page (once) Check the ULS logs! Could be token expiration timeout Could be something else
38. Claims Behaving Badly SPSecurityTokenService.Issue() failed:System.Runtime.InteropServices.COMException (0x800703FA): Retrieving theCOM class factory for component with CLSID{BDEADF26-C265-11D0-BCED-00A0C90AB50F} failed due to the following error: 800703FA. GPEdit: Computer Configuration > Administrative Templates > System > User Profiles Do not forcefully unload the users registry at user logoff > Set to “Enabled”
40. Claims Recommendations Stick with Classic Mode Authentication if you are deploying SharePoint into a “simple” Active Directory environment Particularly if strict security controls are in place that are beyond your control Especially if you are only migrating from Windows authentication in MOSS Once you go to Claims, you can’t go back!
41. Claims Recommendations If you must use Claims for your Extranet,try to minimize the number of zones/host headers used Default zone should be most secure Have a good “troubleshooter’s toolbox” ULS Log Viewer Fiddler Claims Viewer web part
42. Thanks for your time!See me perform at “SharePoint Got Talent”tomorrow night at 8:30!
43. References & Credits Shane Young – my hero! http://sharepoint911.com Plan Authentication Methods(SharePoint Server 2010) http://technet.microsoft.com/en-us/library/cc262350.aspx A Guide to Claims-Based Identity and Access Control (Microsoft Patterns and Practices) http://claimsid.codeplex.com/
44. References & Credits (cont.) Steve Peschka http://blogs.technet.com/b/speschka/archive/2010/06/12/migrating-a-web-application-from-windows-classic-to-windows-claims-in-sharepoint-2010.aspx http://msdn.microsoft.com/en-us/library/hh147183.aspx Project Server Blog (GREAT tips for migrating to Claims here!!!) http://nearbaseline.com.au/blog/tag/claims/
Claims opens up all the doors to you…FBA, Trusted Identity Providers (external-outside world)
WS-Trust: how to request and receive security tokensWS-Federation: architecture for cleanseparation between trust mechanisms, security tokens formats, and the protocols for obtaining tokensSAML: XML vocabulary used to represent claims in an interoperable way
Go to Central Administration and provision a simple new web application using Claims. Log in with an NTLM-based domain account.
Go to Central Administration and provision a simple new web application using Claims. Log in with an NTLM-based domain account.
Configure TIP through PowerShell.
As you plan custom claims providers for use with People Picker in your SharePoint solution, consider the following questions:What will be the source of the values for the users and roles that will be displayed in People Picker query results?What claim data do you want to resolve in the Select People and Groups dialog box?You don’t necessarily need to go through the API or PowerShell, if you have a connection to an LDAP store or a BCS connection to your auth store. You can also map the properties yourself and leave it to the User Profile Synchronization service. That being said, if you’re dependent on BCS then you’ll also need to have SharePoint Enterprise Server license which isn’t available to all customers.Once you’re done you should be able to visit any of the users in your site collection and see their “Name” property set to something that is less likely to confuse your user base. Once the value is set, it helps to make sure that it doesn’t get stomped with any User Profile Synchronization (UPS) that may be in place in your farm.