SlideShare a Scribd company logo
Antonio.maio@titus.com
www.trustsharepoint.com
Sponsors
Enterprise




Standard
SharePoint Saturday Toronto July 2012 - Antonio Maio
Antonio.maio@titus.com
www.trustsharepoint.com
SharePoint Saturday Toronto July 2012 - Antonio Maio
SharePoint Saturday Toronto July 2012 - Antonio Maio
SharePoint Saturday Toronto July 2012 - Antonio Maio
SharePoint Saturday Toronto July 2012 - Antonio Maio
SharePoint Saturday Toronto July 2012 - Antonio Maio
SharePoint Saturday Toronto July 2012 - Antonio Maio
Options for Retrieving/Managing
 Claims
                                                                                                 Claim Rule
                                 Format: SAML/WS-Fed          4. Authenticates
                                                               user & creates
                                                                                                 Claim Rule
                                      Token with                   token
                                                                                                  …
                                        Claims                                                       3. Get info
                                                                                                   (claims) about
                                                                                                        user
              5. User is
         authenticated and
        SharePoint 2010 now
                                                                                              iAttributeStore       …
          has user’s claims                                                  Secure Token Server                    Database or
                                                   2. Requests                      (STS)                            Directory
                                                   authentication &              EX. Active Directory           Ex. Active Directory

SharePoint                                         token                         Federation Services
                                                                                  (ADFS version 2.0)
  2010                Custom Claim Provider
                      Custom Claim Provider                       Trusted Identity Provider
                        …

                     1. User login
                  (with username &                         Client System
                      password)                           Ex. web browser
                                                                                                        SQL DB,
                                                                                                        LDAP, PKI
                                                                                                          etc…
Focus: Custom Claim Providers




SharePoint
  2010           Custom Claim Provider
                 Custom Claim Provider
                   …
                                                           Active Directory
                1. User login
             (with username &             Client System
                 password)               Ex. web browser
SharePoint Saturday Toronto July 2012 - Antonio Maio
SharePoint Saturday Toronto July 2012 - Antonio Maio
Microsoft.SharePoint
Microsoft.IdentityModel
Browse to find it in Program FilesReference AssembliesMicrosoftWindows Identity
Foundationv3.5Microsoft.IdentityModel.dll



using   System;
using   System.Xml;
using   System.IO;
using   System.ServiceModel.Channels;
using   System.Collections.Generic;
using   System.Linq;
using   System.Text;
using   Microsoft.SharePoint;
using   Microsoft.SharePoint.Administration;
using   Microsoft.SharePoint.Administration.Claims;
using   Microsoft.SharePoint.WebControls;



namespace SampleClaimProvider
{
      public class ClearanceClaimProvider : SPClaimProvider
      {
         public ClearanceClaimProvider (string displayName)
           : base(displayName)
              {
         }
      }
}
4.   Implement the Abstract class

     Methods:                    public class ClearanceClaimProvider:SPClaimProvider
     FillClaimTypes              {
                                 }
     FillClaimValueTypes
     FillClaimsForEntity         Right click on SPClaimProvider and select…
     FillEntityTypes
     FillHierarchy
     FillResolve(2 overrides)
     FillSchema
     FillSearch


     Properties:
     Name
     SupportsEntityInformation
     SupportsHierarchy
     SupportsResolve
     SupportsSearch
Returns the
public override string Name                      Claim Provider
   {get { return ProviderInternalName; }}        unique name

public override bool SupportsEntityInformation   Must return True
   {get { return true; }}                        for Claims
                                                 Augmentation
public override bool SupportsHierarchy           Supports hierarchy
   {get { return true; }}                        display in people
                                                 picker
public override bool SupportsResolve
   {get { return true; }}
                                                 Supports resolving
                                                 claim values
public override bool SupportsSearch
   {get { return true; }}                        Supports search
                                                 operation
internal static string ProviderDisplayName
{
   get { return “Security Clearance"; }
}



internal static string ProviderInternalName
{
   get { return “SecurityClearanceProvider"; }
}
private string[] SecurityLevels   new string[]
     { None     Confidential    Secret    Top Secret            };


private static string ClearanceClaimType
{
   get { return "http://schemas.sample.local/clearance"; }
}



private static string ClearanceClaimValueType
{
   get { return Microsoft.IdentityModel.Claims.ClaimValueTypes.String;}
}


• Adding a claim with type URL http://schemas.sample.local/clearance
  and the claim’s value is a string
FillClaimTypes
    FillClaimValueTypes
    FillClaimsForEntity

protected override void FillClaimTypes(List<string> claimTypes)
{
   if (claimTypes == null)
          throw new ArgumentNullException("claimTypes");
    claimTypes.Add(ClearanceClaimType);
}


protected override void FillClaimValueTypes(List<string>
   claimValueTypes)
{
   if (claimValueTypes == null
          throw new ArgumentNullException("claimValueTypes");
    claimValueTypes.Add(ClearanceClaimValueType);
}
FillClaimsForEntity

protected override void FillClaimsForEntity(Uri context, SPClaim entity,
    List<SPClaim> claims)
{
    if (entity == null)
            throw new ArgumentNullException("entity");
    if (claims == null)
            throw new ArgumentNullException("claims");
    if (String.IsNullOrEmpty(entity.Value))
            throw new ArgumentException("Argument null or empty",
            "entity.Value");

    //if existing Clearance claim is „top secret‟ then add lower levels
    clearances
    if (. . .)
    {
            claims.Add(CreateClaim(ClearanceClaimType, SecurityLevels[0],
            ClearanceClaimValueType));

            claims.Add(CreateClaim(ClearanceClaimType, SecurityLevels[1],
            ClearanceClaimValueType));

            claims.Add(CreateClaim(ClearanceClaimType, SecurityLevels[2],
            ClearanceClaimValueType));
    }
    . . .
}
Other Important Methods: Replacing the People Picker

FillEntityTypes
   Set of possible claims to display in the people picker

FillHierarchy
   Hierarchy for displaying claims in the people picker

FillResolve(2 overrides)
   Resolving claims specified in the people picker


FillSchema
   Specifies the schema that is used by people picker to
   display claims/entity data

FillSearch
    Fills in search results in people picker window
FillEntityTypes
FillHierarchy
FillResolve(2 overrides)
FillSchema
FillSearch
protected override void FillEntityTypes(List<string> entityTypes)
{

    //Return the type of entity claim we are using
    entityTypes.Add(SPClaimEntityTypes.FormsRole);
}
protected override void FillHierarchy(Uri context, string[] entityTypes,
     string hierarchyNodeID, int numberOfLevels, SPProviderHierarchyTree hierarchy)
{
      if (!EntityTypesContain(entityTypes, SPClaimEntityTypes.FormsRole))
           return;
      switch (hierarchyNodeID)
      {
         case null: // when it 1st loads, add all our nodes
            hierarchy.AddChild(new Microsoft.SharePoint.WebControls.SPProviderHierarchyNode
                             (SecurityClearance.ProviderInternalName,
                              “SecurityClearance”, “Security Clearance”, true));

            hierarchy.AddChild(new Microsoft.SharePoint.WebControls.SPProviderHierarchyNode
                              (SecurityClearance.ProviderInternalName,
                               “Caveat”, “Caveat”, true));

            break;

           default:
             break;
       }
  }
protected override void FillResolve(Uri context, string[] entityTypes,
                          SPClaim resolveInput, List<PickerEntity> resolved)
{
     if (!EntityTypesContain(entityTypes, SPClaimEntityTypes.FormsRole))
        return;

     Microsoft.SharePoint.WebControls.PickerEntity pe = GetPickerEntity
        (resolveInput.ClaimType, resolveInput.Value);

     resolved.Add(pe);
}
protected override void FillResolve(Uri context, string[] entityTypes,
                        string resolveInput, List<PickerEntity> resolved)
{
     if (!EntityTypesContain(entityTypes, SPClaimEntityTypes.FormsRole))
           return;

     //create a matching entity and add it to the return list of picker entries
     Microsoft.SharePoint.WebControls.PickerEntity pe = GetPickerEntity
           (ClearanceClaimType, resolveInput);

     resolved.Add(pe);

     pe = GetPickerEntity(CaveatClaimType, resolveInput);
     resolved.Add(pe);

}
private Microsoft.SharePoint.WebControls.PickerEntity GetPickerEntity
        (string ClaimType, string ClaimValue)
{
    Microsoft.SharePoint.WebControls.PickerEntity pe = CreatePickerEntity();

    // set the claim associated with this match & tooltip displayed
    pe.Claim = CreateClaim(ClaimType, ClaimValue, ClaimValueType);
    pe.Description = SecurityClearance.ProviderDisplayName + ":" + ClaimValue;

    // Set the text displayed in people picker
    pe.DisplayText = ClaimValue;

    // Store in hash table, plug in as a role type entity & flag as resolved
    pe.EntityData[Microsoft.SharePoint.WebControls.PeopleEditorEntityDataKeys.
       DisplayName] = ClaimValue;
    pe.EntityType = SPClaimEntityTypes.FormsRole;
    pe.IsResolved = true;

    pe.EntityGroupName = "Additional Claims";
       return pe;
}
protected override void FillSchema(SPProviderSchema schema)
{
     schema.AddSchemaElement(new Microsoft.SharePoint.WebControls.SPSchemaElement(
       Microsoft.SharePoint.WebControls.PeopleEditorEntityDataKeys.DisplayName,
       "Display Name", Microsoft.SharePoint.WebControls.SPSchemaElementType.Both));
}
protected override void FillSearch(Uri context, string[] entityTypes,
      string searchPattern, string hierarchyNodeID,int maxCount,
      SPProviderHierarchyTree searchTree)
{
    if (!EntityTypesContain(entityTypes, SPClaimEntityTypes.FormsRole))
           return;

       // The node where we will place our matches
       Microsoft.SharePoint.WebControls.SPProviderHierarchyNode matchNode = null;

       Microsoft.SharePoint.WebControls.PickerEntity pe = GetPickerEntity
            (ClearanceClaimType, searchPattern);

       if (!searchTree.HasChild(“SecurityClearance”))
       {    // create the node so that we can show our match in there too
            matchNode = new Microsoft.SharePoint.WebControls.SPProviderHierarchyNode
               (SecurityClearance.ProviderInternalName, “Security Clearance”,
                “SecurityClearance”, true);
            searchTree.AddChild(matchNode);
       }
       else
       {
            // get the node for this security level
            matchNode = searchTree.Children.Where(theNode => theNode.HierarchyNodeID
             == “SecurityClearance”).First();
       }

       // add the picker entity to our tree node
       matchNode.AddEntity(pe);
}
protected override void FillSearch(Uri context, string[] entityTypes,
      string searchPattern, string hierarchyNodeID,int maxCount,
      SPProviderHierarchyTree searchTree)
{
    if (!EntityTypesContain(entityTypes, SPClaimEntityTypes.FormsRole))
           return;

       // The node where we will place our matches
       Microsoft.SharePoint.WebControls.SPProviderHierarchyNode matchNode = null;

       Microsoft.SharePoint.WebControls.PickerEntity pe = GetPickerEntity
            (ClearanceClaimType, searchPattern);

       if (!searchTree.HasChild(“SecurityClearance”))
       {    // create the node so that we can show our match in there too
            matchNode = new Microsoft.SharePoint.WebControls.SPProviderHierarchyNode
               (SecurityClearance.ProviderInternalName, “Security Clearance”,
                “SecurityClearance”, true);
            searchTree.AddChild(matchNode);
       }
       else
       {
            // get the node for this security level
            matchNode = searchTree.Children.Where(theNode => theNode.HierarchyNodeID
             == “SecurityClearance”).First();
       }

       // add the picker entity to our tree node
       matchNode.AddEntity(pe);
}
SharePoint Saturday Toronto July 2012 - Antonio Maio
protected override void FillClaimsForEntity(Uri context, SPClaim entity, List<SPClaim> claims)
{
    . . .

    DateTime now = DateTime.Now;
    if((now.DayOfWeek == DayOfWeek.Saturday)||(now.DayOfWeek == DayOfWeek.Sunday))
    {
        claims.Add(CreateClaim(WorkDayClaimType,”false”, WorkDayClaimValueType));
        return;
    }

    DateTime start = new DateTime(now.Year, now.Month, now.Day, 9, 0, 0)); //9 o'clock AM
    DateTime end = new DateTime(now.Year, now.Month, now.Day, 17, 0, 0)); //5 o'clock PM

    if ((now < start) || (now > end))
    {
        claims.Add(CreateClaim(WorkDayClaimType,”false”, WorkDayClaimValueType));
        return;
    }

    claims.Add(CreateClaim(WorkDayClaimType, ”true”, WorkDayClaimValueType));
}
http://intranet/_vti_bin/listdata.svc
SharePoint Saturday Toronto July 2012 - Antonio Maio
SharePoint Saturday Toronto July 2012 - Antonio Maio
Deployed as a Farm Level Feature Receiver – requires more code
   Must inherit from SPClaimProviderFeatureReceiver (lots of examples)

Can deploy multiple claim providers
   Called in order of deployment

Once deployed - Available in every web app, in very zone
   Can cause performance issues
   When user logs in, all Custom Claim Providers deployed get called

   Set IsUsedByDefault property in Feature Receiver Def'n to False;
   then turn it on manually for required web apps
Reach out to SQL database, LDAP, Repository for attributes
which will get added as claims
Custom Claim Provider running in the context of the web
application, and not the site the user is logging into
   Logged in as the Central Admin Service Account
   Do not have context
   (Most methods have no HTTP Context nor SPContext.Current)

   Cannot directly access data on the Site you signed into


For Debugging use a Claims Testing Web Part in SharePoint:
   http://blogs.technet.com/b/speschka/archive/2010/02/13/figuring-out-
   what-claims-you-have-in-sharepoint-2010.aspx
Sponsors
Enterprise




Standard
REGISTER NOW!
                               www.sharepointconference.com



Join us in Las
Vegas for
SharePoint
                        Don’t miss this         Engage with
                                                the
Conference              opportunity to          community
2012!
                        join us in Las
Give yourself a         Vegas at the
competitive edge        Mandalay Bay                Share
                                                   insights
and get the inside
scoop about
                        November 12-15
'SharePoint 15' while                           Learn about
learning how to                                 what’s coming
                                                next, from the
better use                                      people who
                                                built the
SharePoint 2010                                 product

More Related Content

PDF
Developing custom claim providers to enable authorization in share point an...
AntonioMaio2
 
PPTX
SharePoint Access Control and Claims Based Authentication
Jonathan Schultz
 
PDF
Understanding Claim based Authentication
Mohammad Yousri
 
PDF
How Claims is Changing the Way We Authenticate and Authorize in SharePoint
AntonioMaio2
 
PPTX
Claims Based Authentication A Beginners Guide
Phuong Nguyen
 
PDF
Create a Uniform Login Experience with a Centralized Cloud Authentication Sys...
Xamarin
 
PDF
Deciphering 'Claims-based Identity'
Oliver Pfaff
 
PDF
Authentication through Claims-Based Authentication
ijtsrd
 
Developing custom claim providers to enable authorization in share point an...
AntonioMaio2
 
SharePoint Access Control and Claims Based Authentication
Jonathan Schultz
 
Understanding Claim based Authentication
Mohammad Yousri
 
How Claims is Changing the Way We Authenticate and Authorize in SharePoint
AntonioMaio2
 
Claims Based Authentication A Beginners Guide
Phuong Nguyen
 
Create a Uniform Login Experience with a Centralized Cloud Authentication Sys...
Xamarin
 
Deciphering 'Claims-based Identity'
Oliver Pfaff
 
Authentication through Claims-Based Authentication
ijtsrd
 

What's hot (16)

PDF
Claim based authentaication
Sean Xiong
 
PPTX
T28 implementing adfs and hybrid share point
Thorbjørn Værp
 
PPTX
Claim Based Authentication in SharePoint 2010 for Community Day 2011
Joris Poelmans
 
PDF
Stateless Auth using OAUTH2 & JWT
Mobiliya
 
PPTX
Azure AD B2C Webinar Series: Identity Protocols OIDC and OAuth2 part 1
Vinu Gunasekaran
 
PPTX
AD FS Workshop | Part 2 | Deep Dive
Granikos GmbH & Co. KG
 
PPTX
SharePoint 2010 Extranets and Authentication: How will SharePoint 2010 connec...
Brian Culver
 
PPTX
Azure AD B2C Webinar Series: Custom Policies Part 2 Policy Walkthrough
Vinu Gunasekaran
 
PPTX
MongoDB.local Sydney: Evolving your Data Access with MongoDB Stitch
MongoDB
 
PDF
Unlock your Big Data with Analytics and BI on Office 365 - OFF103
Brian Culver
 
PDF
SharePointFest 2013 Washington DC - SPT 103 - SharePoint 2013 Extranets: How ...
Brian Culver
 
PPTX
Leveraging SharePoint for Extranets
Avtex
 
PPTX
Cloud Native Journey in Synchrony Financial
VMware Tanzu
 
PPTX
The Who, What, Why and How of Active Directory Federation Services (AD FS)
Jay Simcox
 
PPTX
Presentation
Laxman Kumar
 
PDF
CIS13: How to Build a Federated Identity Service on Identity and Context Virt...
CloudIDSummit
 
Claim based authentaication
Sean Xiong
 
T28 implementing adfs and hybrid share point
Thorbjørn Værp
 
Claim Based Authentication in SharePoint 2010 for Community Day 2011
Joris Poelmans
 
Stateless Auth using OAUTH2 & JWT
Mobiliya
 
Azure AD B2C Webinar Series: Identity Protocols OIDC and OAuth2 part 1
Vinu Gunasekaran
 
AD FS Workshop | Part 2 | Deep Dive
Granikos GmbH & Co. KG
 
SharePoint 2010 Extranets and Authentication: How will SharePoint 2010 connec...
Brian Culver
 
Azure AD B2C Webinar Series: Custom Policies Part 2 Policy Walkthrough
Vinu Gunasekaran
 
MongoDB.local Sydney: Evolving your Data Access with MongoDB Stitch
MongoDB
 
Unlock your Big Data with Analytics and BI on Office 365 - OFF103
Brian Culver
 
SharePointFest 2013 Washington DC - SPT 103 - SharePoint 2013 Extranets: How ...
Brian Culver
 
Leveraging SharePoint for Extranets
Avtex
 
Cloud Native Journey in Synchrony Financial
VMware Tanzu
 
The Who, What, Why and How of Active Directory Federation Services (AD FS)
Jay Simcox
 
Presentation
Laxman Kumar
 
CIS13: How to Build a Federated Identity Service on Identity and Context Virt...
CloudIDSummit
 
Ad

Viewers also liked (17)

PPTX
My thoughts
Kripi Mehra
 
PPTX
Kurds in Rojava- Syrian kurdistan
Dr Janroj Keles
 
PPT
'Between the Sheets' - The NAKED TRUTH about sex...
onechurch
 
PDF
ANIMALES DE LA GRANJA
Sònia Ripoll Ortega
 
PDF
Alueiden muuttovetovoima 2009 2013
TimoAro
 
PDF
Predictive profile example.
Kate Alama
 
PDF
Myyttejä ja faktoja Porista!
TimoAro
 
PDF
Keeping SharePoint Always On
AntonioMaio2
 
PDF
02 aug 12 3rd bde weekly update (2)
Laura Anderson
 
PPTX
New microsoft office power point presentation annerose
Anne Rose de Asis
 
PPT
Simple present tense iwona
Iwonakorch
 
PDF
Selenium私房菜(新手入门教程)
bwgang
 
PPT
Information Technology and Firm Profitability - Team Topaz
Tim Enalls
 
PDF
Apostila de fotografia básica professor fernando feijó - curso basico-fotogr...
Albano Ocaranguejodigital
 
PDF
Kuopion alueen menestys 2000 luvulla
TimoAro
 
PDF
Joshua Potter Design Portfolio
Joshua Potter
 
PDF
Materials and resources parents
Amber Burkholder
 
My thoughts
Kripi Mehra
 
Kurds in Rojava- Syrian kurdistan
Dr Janroj Keles
 
'Between the Sheets' - The NAKED TRUTH about sex...
onechurch
 
ANIMALES DE LA GRANJA
Sònia Ripoll Ortega
 
Alueiden muuttovetovoima 2009 2013
TimoAro
 
Predictive profile example.
Kate Alama
 
Myyttejä ja faktoja Porista!
TimoAro
 
Keeping SharePoint Always On
AntonioMaio2
 
02 aug 12 3rd bde weekly update (2)
Laura Anderson
 
New microsoft office power point presentation annerose
Anne Rose de Asis
 
Simple present tense iwona
Iwonakorch
 
Selenium私房菜(新手入门教程)
bwgang
 
Information Technology and Firm Profitability - Team Topaz
Tim Enalls
 
Apostila de fotografia básica professor fernando feijó - curso basico-fotogr...
Albano Ocaranguejodigital
 
Kuopion alueen menestys 2000 luvulla
TimoAro
 
Joshua Potter Design Portfolio
Joshua Potter
 
Materials and resources parents
Amber Burkholder
 
Ad

Similar to SharePoint Saturday Toronto July 2012 - Antonio Maio (20)

PPTX
Share point security 101 sps-ottawa 2012 - antonio maio
AntonioMaio2
 
PPTX
SPSBE 2013 Claims for devs
Steven Van de Craen
 
PPTX
Thomas vochten claims-spsbe26
BIWUG
 
PPTX
SharePoint, ADFS and Claims Auth
Kashif Imran
 
PPTX
DD109 Claims Based AuthN in SharePoint 2010
Spencer Harbar
 
PPTX
SharePoint Saturday Utah - Do you claim to be from the Azure Sky?
Liam Cleary [MVP]
 
PPTX
Claims Based Identity In Share Point 2010
Steve Sofian
 
PPTX
SharePoint and Office Development Workshop
Eric Shupps
 
PDF
SharePoint Saturday The Conference 2011 - Extranets & Claims Authentication
Brian Culver
 
PPTX
ESPC15 - Extending Authentication and Authorization
Edin Kapic
 
PPTX
Extending Authentication and Authorization
Edin Kapic
 
PPTX
HAD05: Collaborating with Extranet Partners on SharePoint 2010
Michael Noel
 
PPTX
SharePoint 2010 authentications
Wyngate Solutions
 
PPTX
SharePoint Authentication And Authorization SPTechCon San Francisco
Liam Cleary [MVP]
 
PDF
IBM Connections and Desktop Single Sign-On using Microsoft Active Directory, ...
Dave Hay
 
PPTX
Troubleshooting Federation, ADFS, and More
Microsoft TechNet - Belgium and Luxembourg
 
PPTX
SEASPC 2011 - Collaborating with Extranet Partners on SharePoint 2010
Michael Noel
 
PPTX
SharePoint and Office 365 Development Workshop
Eric Shupps
 
PPTX
Identity & access management jonas syrstad
Meandmine2
 
PDF
Using Windows Azure for Solving Identity Management Challenges (Visual Studio...
Michael Collier
 
Share point security 101 sps-ottawa 2012 - antonio maio
AntonioMaio2
 
SPSBE 2013 Claims for devs
Steven Van de Craen
 
Thomas vochten claims-spsbe26
BIWUG
 
SharePoint, ADFS and Claims Auth
Kashif Imran
 
DD109 Claims Based AuthN in SharePoint 2010
Spencer Harbar
 
SharePoint Saturday Utah - Do you claim to be from the Azure Sky?
Liam Cleary [MVP]
 
Claims Based Identity In Share Point 2010
Steve Sofian
 
SharePoint and Office Development Workshop
Eric Shupps
 
SharePoint Saturday The Conference 2011 - Extranets & Claims Authentication
Brian Culver
 
ESPC15 - Extending Authentication and Authorization
Edin Kapic
 
Extending Authentication and Authorization
Edin Kapic
 
HAD05: Collaborating with Extranet Partners on SharePoint 2010
Michael Noel
 
SharePoint 2010 authentications
Wyngate Solutions
 
SharePoint Authentication And Authorization SPTechCon San Francisco
Liam Cleary [MVP]
 
IBM Connections and Desktop Single Sign-On using Microsoft Active Directory, ...
Dave Hay
 
Troubleshooting Federation, ADFS, and More
Microsoft TechNet - Belgium and Luxembourg
 
SEASPC 2011 - Collaborating with Extranet Partners on SharePoint 2010
Michael Noel
 
SharePoint and Office 365 Development Workshop
Eric Shupps
 
Identity & access management jonas syrstad
Meandmine2
 
Using Windows Azure for Solving Identity Management Challenges (Visual Studio...
Michael Collier
 

More from AntonioMaio2 (20)

PDF
Introduction to Microsoft Enterprise Mobility + Security
AntonioMaio2
 
PDF
Learn how to protect against and recover from data breaches in Office 365
AntonioMaio2
 
PDF
A beginners guide to administering office 365 with power shell antonio maio
AntonioMaio2
 
PDF
Office 365 Security - MacGyver, Ninja or Swat team
AntonioMaio2
 
PDF
Information security in office 365 a shared responsibility - antonio maio
AntonioMaio2
 
PDF
SharePoint Saturday Ottawa - How secure is my data in office 365?
AntonioMaio2
 
PPTX
Office 365 security new innovations from microsoft ignite - antonio maio
AntonioMaio2
 
PPTX
Real world SharePoint information governance a case study - published
AntonioMaio2
 
PDF
Overcoming Security Threats and Vulnerabilities in SharePoint
AntonioMaio2
 
PPTX
What’s new in SharePoint 2016!
AntonioMaio2
 
PPTX
Data Visualization in SharePoint and Office 365
AntonioMaio2
 
PPTX
Hybrid Identity Management with SharePoint and Office 365 - Antonio Maio
AntonioMaio2
 
PPTX
Identity management challenges when moving share point to the cloud antonio...
AntonioMaio2
 
PDF
A Practical Guide Information Governance with Microsoft SharePoint 2013
AntonioMaio2
 
PPTX
Best practices for security and governance in share point 2013 published
AntonioMaio2
 
PPTX
Best practices for Security and Governance in SharePoint 2013
AntonioMaio2
 
PPTX
SPTechCon Boston 2013 - Introduction to Security in Microsoft Sharepoint 2013...
AntonioMaio2
 
PPTX
Best Practices for Security in Microsoft SharePoint 2013
AntonioMaio2
 
PPTX
Intro to Develop and Deploy Apps for Microsoft SharePoint and Office 2013
AntonioMaio2
 
PPTX
SharePoint Governance: Impacts of Moving to the Cloud
AntonioMaio2
 
Introduction to Microsoft Enterprise Mobility + Security
AntonioMaio2
 
Learn how to protect against and recover from data breaches in Office 365
AntonioMaio2
 
A beginners guide to administering office 365 with power shell antonio maio
AntonioMaio2
 
Office 365 Security - MacGyver, Ninja or Swat team
AntonioMaio2
 
Information security in office 365 a shared responsibility - antonio maio
AntonioMaio2
 
SharePoint Saturday Ottawa - How secure is my data in office 365?
AntonioMaio2
 
Office 365 security new innovations from microsoft ignite - antonio maio
AntonioMaio2
 
Real world SharePoint information governance a case study - published
AntonioMaio2
 
Overcoming Security Threats and Vulnerabilities in SharePoint
AntonioMaio2
 
What’s new in SharePoint 2016!
AntonioMaio2
 
Data Visualization in SharePoint and Office 365
AntonioMaio2
 
Hybrid Identity Management with SharePoint and Office 365 - Antonio Maio
AntonioMaio2
 
Identity management challenges when moving share point to the cloud antonio...
AntonioMaio2
 
A Practical Guide Information Governance with Microsoft SharePoint 2013
AntonioMaio2
 
Best practices for security and governance in share point 2013 published
AntonioMaio2
 
Best practices for Security and Governance in SharePoint 2013
AntonioMaio2
 
SPTechCon Boston 2013 - Introduction to Security in Microsoft Sharepoint 2013...
AntonioMaio2
 
Best Practices for Security in Microsoft SharePoint 2013
AntonioMaio2
 
Intro to Develop and Deploy Apps for Microsoft SharePoint and Office 2013
AntonioMaio2
 
SharePoint Governance: Impacts of Moving to the Cloud
AntonioMaio2
 

Recently uploaded (20)

PPTX
Comunidade Salesforce São Paulo - Desmistificando o Omnistudio (Vlocity)
Francisco Vieira Júnior
 
PDF
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
PDF
How Onsite IT Support Drives Business Efficiency, Security, and Growth.pdf
Captain IT
 
PDF
CIFDAQ'S Market Insight: BTC to ETH money in motion
CIFDAQ
 
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
AVTRON Technologies LLC
 
PDF
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
PDF
CIFDAQ's Token Spotlight: SKY - A Forgotten Giant's Comeback?
CIFDAQ
 
DOCX
Top AI API Alternatives to OpenAI: A Side-by-Side Breakdown
vilush
 
PDF
Enable Enterprise-Ready Security on IBM i Systems.pdf
Precisely
 
PDF
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
PDF
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
PDF
agentic-ai-and-the-future-of-autonomous-systems.pdf
siddharthnetsavvies
 
PDF
madgavkar20181017ppt McKinsey Presentation.pdf
georgschmitzdoerner
 
PDF
How-Cloud-Computing-Impacts-Businesses-in-2025-and-Beyond.pdf
Artjoker Software Development Company
 
PDF
DevOps & Developer Experience Summer BBQ
AUGNYC
 
PDF
Test Bank, Solutions for Java How to Program, An Objects-Natural Approach, 12...
famaw19526
 
PPTX
The Power of IoT Sensor Integration in Smart Infrastructure and Automation.pptx
Rejig Digital
 
PPTX
How to Build a Scalable Micro-Investing Platform in 2025 - A Founder’s Guide ...
Third Rock Techkno
 
PDF
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
PDF
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
Comunidade Salesforce São Paulo - Desmistificando o Omnistudio (Vlocity)
Francisco Vieira Júnior
 
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
How Onsite IT Support Drives Business Efficiency, Security, and Growth.pdf
Captain IT
 
CIFDAQ'S Market Insight: BTC to ETH money in motion
CIFDAQ
 
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
AVTRON Technologies LLC
 
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
CIFDAQ's Token Spotlight: SKY - A Forgotten Giant's Comeback?
CIFDAQ
 
Top AI API Alternatives to OpenAI: A Side-by-Side Breakdown
vilush
 
Enable Enterprise-Ready Security on IBM i Systems.pdf
Precisely
 
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
agentic-ai-and-the-future-of-autonomous-systems.pdf
siddharthnetsavvies
 
madgavkar20181017ppt McKinsey Presentation.pdf
georgschmitzdoerner
 
How-Cloud-Computing-Impacts-Businesses-in-2025-and-Beyond.pdf
Artjoker Software Development Company
 
DevOps & Developer Experience Summer BBQ
AUGNYC
 
Test Bank, Solutions for Java How to Program, An Objects-Natural Approach, 12...
famaw19526
 
The Power of IoT Sensor Integration in Smart Infrastructure and Automation.pptx
Rejig Digital
 
How to Build a Scalable Micro-Investing Platform in 2025 - A Founder’s Guide ...
Third Rock Techkno
 
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 

SharePoint Saturday Toronto July 2012 - Antonio Maio

  • 11. Options for Retrieving/Managing Claims Claim Rule Format: SAML/WS-Fed 4. Authenticates user & creates Claim Rule Token with token … Claims 3. Get info (claims) about user 5. User is authenticated and SharePoint 2010 now iAttributeStore … has user’s claims Secure Token Server Database or 2. Requests (STS) Directory authentication & EX. Active Directory Ex. Active Directory SharePoint token Federation Services (ADFS version 2.0) 2010 Custom Claim Provider Custom Claim Provider Trusted Identity Provider … 1. User login (with username & Client System password) Ex. web browser SQL DB, LDAP, PKI etc…
  • 12. Focus: Custom Claim Providers SharePoint 2010 Custom Claim Provider Custom Claim Provider … Active Directory 1. User login (with username & Client System password) Ex. web browser
  • 15. Microsoft.SharePoint Microsoft.IdentityModel Browse to find it in Program FilesReference AssembliesMicrosoftWindows Identity Foundationv3.5Microsoft.IdentityModel.dll using System; using System.Xml; using System.IO; using System.ServiceModel.Channels; using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft.SharePoint; using Microsoft.SharePoint.Administration; using Microsoft.SharePoint.Administration.Claims; using Microsoft.SharePoint.WebControls; namespace SampleClaimProvider { public class ClearanceClaimProvider : SPClaimProvider { public ClearanceClaimProvider (string displayName) : base(displayName) { } } }
  • 16. 4. Implement the Abstract class Methods: public class ClearanceClaimProvider:SPClaimProvider FillClaimTypes { } FillClaimValueTypes FillClaimsForEntity Right click on SPClaimProvider and select… FillEntityTypes FillHierarchy FillResolve(2 overrides) FillSchema FillSearch Properties: Name SupportsEntityInformation SupportsHierarchy SupportsResolve SupportsSearch
  • 17. Returns the public override string Name Claim Provider {get { return ProviderInternalName; }} unique name public override bool SupportsEntityInformation Must return True {get { return true; }} for Claims Augmentation public override bool SupportsHierarchy Supports hierarchy {get { return true; }} display in people picker public override bool SupportsResolve {get { return true; }} Supports resolving claim values public override bool SupportsSearch {get { return true; }} Supports search operation
  • 18. internal static string ProviderDisplayName { get { return “Security Clearance"; } } internal static string ProviderInternalName { get { return “SecurityClearanceProvider"; } }
  • 19. private string[] SecurityLevels new string[] { None Confidential Secret Top Secret }; private static string ClearanceClaimType { get { return "http://schemas.sample.local/clearance"; } } private static string ClearanceClaimValueType { get { return Microsoft.IdentityModel.Claims.ClaimValueTypes.String;} } • Adding a claim with type URL http://schemas.sample.local/clearance and the claim’s value is a string
  • 20. FillClaimTypes FillClaimValueTypes FillClaimsForEntity protected override void FillClaimTypes(List<string> claimTypes) { if (claimTypes == null) throw new ArgumentNullException("claimTypes"); claimTypes.Add(ClearanceClaimType); } protected override void FillClaimValueTypes(List<string> claimValueTypes) { if (claimValueTypes == null throw new ArgumentNullException("claimValueTypes"); claimValueTypes.Add(ClearanceClaimValueType); }
  • 21. FillClaimsForEntity protected override void FillClaimsForEntity(Uri context, SPClaim entity, List<SPClaim> claims) { if (entity == null) throw new ArgumentNullException("entity"); if (claims == null) throw new ArgumentNullException("claims"); if (String.IsNullOrEmpty(entity.Value)) throw new ArgumentException("Argument null or empty", "entity.Value"); //if existing Clearance claim is „top secret‟ then add lower levels clearances if (. . .) { claims.Add(CreateClaim(ClearanceClaimType, SecurityLevels[0], ClearanceClaimValueType)); claims.Add(CreateClaim(ClearanceClaimType, SecurityLevels[1], ClearanceClaimValueType)); claims.Add(CreateClaim(ClearanceClaimType, SecurityLevels[2], ClearanceClaimValueType)); } . . . }
  • 22. Other Important Methods: Replacing the People Picker FillEntityTypes Set of possible claims to display in the people picker FillHierarchy Hierarchy for displaying claims in the people picker FillResolve(2 overrides) Resolving claims specified in the people picker FillSchema Specifies the schema that is used by people picker to display claims/entity data FillSearch Fills in search results in people picker window
  • 24. protected override void FillEntityTypes(List<string> entityTypes) { //Return the type of entity claim we are using entityTypes.Add(SPClaimEntityTypes.FormsRole); }
  • 25. protected override void FillHierarchy(Uri context, string[] entityTypes, string hierarchyNodeID, int numberOfLevels, SPProviderHierarchyTree hierarchy) { if (!EntityTypesContain(entityTypes, SPClaimEntityTypes.FormsRole)) return; switch (hierarchyNodeID) { case null: // when it 1st loads, add all our nodes hierarchy.AddChild(new Microsoft.SharePoint.WebControls.SPProviderHierarchyNode (SecurityClearance.ProviderInternalName, “SecurityClearance”, “Security Clearance”, true)); hierarchy.AddChild(new Microsoft.SharePoint.WebControls.SPProviderHierarchyNode (SecurityClearance.ProviderInternalName, “Caveat”, “Caveat”, true)); break; default: break; } }
  • 26. protected override void FillResolve(Uri context, string[] entityTypes, SPClaim resolveInput, List<PickerEntity> resolved) { if (!EntityTypesContain(entityTypes, SPClaimEntityTypes.FormsRole)) return; Microsoft.SharePoint.WebControls.PickerEntity pe = GetPickerEntity (resolveInput.ClaimType, resolveInput.Value); resolved.Add(pe); }
  • 27. protected override void FillResolve(Uri context, string[] entityTypes, string resolveInput, List<PickerEntity> resolved) { if (!EntityTypesContain(entityTypes, SPClaimEntityTypes.FormsRole)) return; //create a matching entity and add it to the return list of picker entries Microsoft.SharePoint.WebControls.PickerEntity pe = GetPickerEntity (ClearanceClaimType, resolveInput); resolved.Add(pe); pe = GetPickerEntity(CaveatClaimType, resolveInput); resolved.Add(pe); }
  • 28. private Microsoft.SharePoint.WebControls.PickerEntity GetPickerEntity (string ClaimType, string ClaimValue) { Microsoft.SharePoint.WebControls.PickerEntity pe = CreatePickerEntity(); // set the claim associated with this match & tooltip displayed pe.Claim = CreateClaim(ClaimType, ClaimValue, ClaimValueType); pe.Description = SecurityClearance.ProviderDisplayName + ":" + ClaimValue; // Set the text displayed in people picker pe.DisplayText = ClaimValue; // Store in hash table, plug in as a role type entity & flag as resolved pe.EntityData[Microsoft.SharePoint.WebControls.PeopleEditorEntityDataKeys. DisplayName] = ClaimValue; pe.EntityType = SPClaimEntityTypes.FormsRole; pe.IsResolved = true; pe.EntityGroupName = "Additional Claims"; return pe; }
  • 29. protected override void FillSchema(SPProviderSchema schema) { schema.AddSchemaElement(new Microsoft.SharePoint.WebControls.SPSchemaElement( Microsoft.SharePoint.WebControls.PeopleEditorEntityDataKeys.DisplayName, "Display Name", Microsoft.SharePoint.WebControls.SPSchemaElementType.Both)); }
  • 30. protected override void FillSearch(Uri context, string[] entityTypes, string searchPattern, string hierarchyNodeID,int maxCount, SPProviderHierarchyTree searchTree) { if (!EntityTypesContain(entityTypes, SPClaimEntityTypes.FormsRole)) return; // The node where we will place our matches Microsoft.SharePoint.WebControls.SPProviderHierarchyNode matchNode = null; Microsoft.SharePoint.WebControls.PickerEntity pe = GetPickerEntity (ClearanceClaimType, searchPattern); if (!searchTree.HasChild(“SecurityClearance”)) { // create the node so that we can show our match in there too matchNode = new Microsoft.SharePoint.WebControls.SPProviderHierarchyNode (SecurityClearance.ProviderInternalName, “Security Clearance”, “SecurityClearance”, true); searchTree.AddChild(matchNode); } else { // get the node for this security level matchNode = searchTree.Children.Where(theNode => theNode.HierarchyNodeID == “SecurityClearance”).First(); } // add the picker entity to our tree node matchNode.AddEntity(pe); }
  • 31. protected override void FillSearch(Uri context, string[] entityTypes, string searchPattern, string hierarchyNodeID,int maxCount, SPProviderHierarchyTree searchTree) { if (!EntityTypesContain(entityTypes, SPClaimEntityTypes.FormsRole)) return; // The node where we will place our matches Microsoft.SharePoint.WebControls.SPProviderHierarchyNode matchNode = null; Microsoft.SharePoint.WebControls.PickerEntity pe = GetPickerEntity (ClearanceClaimType, searchPattern); if (!searchTree.HasChild(“SecurityClearance”)) { // create the node so that we can show our match in there too matchNode = new Microsoft.SharePoint.WebControls.SPProviderHierarchyNode (SecurityClearance.ProviderInternalName, “Security Clearance”, “SecurityClearance”, true); searchTree.AddChild(matchNode); } else { // get the node for this security level matchNode = searchTree.Children.Where(theNode => theNode.HierarchyNodeID == “SecurityClearance”).First(); } // add the picker entity to our tree node matchNode.AddEntity(pe); }
  • 33. protected override void FillClaimsForEntity(Uri context, SPClaim entity, List<SPClaim> claims) { . . . DateTime now = DateTime.Now; if((now.DayOfWeek == DayOfWeek.Saturday)||(now.DayOfWeek == DayOfWeek.Sunday)) { claims.Add(CreateClaim(WorkDayClaimType,”false”, WorkDayClaimValueType)); return; } DateTime start = new DateTime(now.Year, now.Month, now.Day, 9, 0, 0)); //9 o'clock AM DateTime end = new DateTime(now.Year, now.Month, now.Day, 17, 0, 0)); //5 o'clock PM if ((now < start) || (now > end)) { claims.Add(CreateClaim(WorkDayClaimType,”false”, WorkDayClaimValueType)); return; } claims.Add(CreateClaim(WorkDayClaimType, ”true”, WorkDayClaimValueType)); }
  • 37. Deployed as a Farm Level Feature Receiver – requires more code Must inherit from SPClaimProviderFeatureReceiver (lots of examples) Can deploy multiple claim providers Called in order of deployment Once deployed - Available in every web app, in very zone Can cause performance issues When user logs in, all Custom Claim Providers deployed get called Set IsUsedByDefault property in Feature Receiver Def'n to False; then turn it on manually for required web apps
  • 38. Reach out to SQL database, LDAP, Repository for attributes which will get added as claims Custom Claim Provider running in the context of the web application, and not the site the user is logging into Logged in as the Central Admin Service Account Do not have context (Most methods have no HTTP Context nor SPContext.Current) Cannot directly access data on the Site you signed into For Debugging use a Claims Testing Web Part in SharePoint: http://blogs.technet.com/b/speschka/archive/2010/02/13/figuring-out- what-claims-you-have-in-sharepoint-2010.aspx
  • 40. REGISTER NOW! www.sharepointconference.com Join us in Las Vegas for SharePoint Don’t miss this Engage with the Conference opportunity to community 2012! join us in Las Give yourself a Vegas at the competitive edge Mandalay Bay Share insights and get the inside scoop about November 12-15 'SharePoint 15' while Learn about learning how to what’s coming next, from the better use people who built the SharePoint 2010 product

Editor's Notes

  • #20: We’re adding a claim with a name of http://schemas.sample.local/clearance and the value in that claim is a string