IT tutorials
 
Technology
 

Sharepoint 2013 : Claims-based authentication, federated identities, and OAuth (part 4) - SharePoint trusted IPs - Configuring the target web application

9/21/2013 7:41:14 PM
- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019

3. SharePoint trusted IPs

3.1 Trusting the IP/STS

To begin, you need to trust the IP from the perspective of SharePoint. Therefore, you need to retrieve the certificate of the IP/STS and register it in the list of trusted issuers of SharePoint. If you are consuming an STS published by a third-party IP, then you can extract the public key of the certificate from the FederationMetadata.xml file, selecting the following XPath node:

EntityDescriptor/RoleDescriptor/KeyDescriptor/KeyInfo/X509Data/X509Certificate

You can simply copy the content of that XML node into a text file and save it with a .cer file extension.

Otherwise, if you are working with an IP/STS published by the same machine on which you are running SharePoint, you can export the .cer certificate file from the local-machine certificate store. You then can import the .cer file into the private SharePoint 2013 certificate store either by using a Windows PowerShell script or the UI of the SharePoint Central Administration (SPCA). In Windows PowerShell, use the following syntax:

$cert = New-Object System.Security.Cryptography.X509Certificates.
X509Certificate2("IPSTSCert.cer")
New-SPTrustedRootAuthority -Name "DevLeap Sample IP/STS" -Certificate $cert

With this cmdlet, you can retrieve an instance of the X509Certificate2 class by referencing the .cer file path, and then load it by invoking the New-SPTrustedRootAuthority cmdlet specific to SharePoint 2013. If the certificate is not trusted by the servers in your SharePoint 2013 farm—for example, if it is a custom self-created certificate—you will have to trust the whole certificate chain in the SharePoint 2013 farm. Executing the script on a single server is sufficient to trust the whole farm.

If you prefer to use the UI of SPCA, browse to the Security section, select Manage Trust, and then in the Trust Relationships ribbon group, click the New button to add a new item. You will have to provide a name and the path to the .cer file to the Establish Trust Relationship page, as shown in Figure 6.

A screen shot illustrating the Establish Trust Relationship page, which allows configuring a certificate trust. It includes fields for defining the certificate name and the path of the certificate to trust, as well as some advanced options for trusting an STS of a third-party farm.

Figure 6. The Establish Trust Relationship page for registering a new trust relationship.

Registering the IP and mapping claims

Now you are ready to register the custom IP/STS in SharePoint 2013. To begin, define the claims that you would like to manage, and then map them to claims that will be available on the SharePoint side. Each time you authenticate a subject by using an external IP/STS, you have the capability to map the claims emitted by the STS in the security token to claims of the SharePoint side. For example, the custom IP/STS discussed earlier returns a claim of type http://schemas.devleap.com/Claims/Gender, which represents the gender of the current user from the IP/STS viewpoint. In SharePoint, you will have the opportunity to map this claim to another claim type, or you can leave it as-is. The claims-based authentication infrastructure of SharePoint will translate claims for you during user authentication.

Important

The claims-mapping capability is extremely useful and important, because you could have multiple IPs registered for a single web application, and the capability to translate claims from one type to another allows SharePoint to normalize claims during authentication. You also have the capability to implement custom claim providers, inheriting from the class SPClaimProvider, to augment claims of a current principal during the authentication phase.

To register claims mapping, you can use a few commands in Windows PowerShell. Here are the commands for mapping the claims issued by the custom STS:

$map1 = New-SPClaimTypeMapping -IncomingClaimType "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress" -IncomingClaimTypeDisplayName "Email" -SameAsIncoming 
$map2 = New-SPClaimTypeMapping -IncomingClaimType "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/gender" -IncomingClaimTypeDisplayName "Gender" -SameAsIncoming
$map3 = New-SPClaimTypeMapping -IncomingClaimType "http://schemas.devleap.com/SampleIPSTS/claims/favoritecolor" -IncomingClaimTypeDisplayName "FavoriteColor" -SameAsIncoming

Here, any email, gender, and favoritecolor claims are left as they are when they come in (see the argument -SameAsIncoming).

The last step for registering an external IP is to create a new entry for the IP in the list of available providers. Again, you can use a Windows PowerShell script to accomplish this:

$realm = "http://claims.sp2013.local/_trust/default.aspx"
$signinurl = "https://localhost:44334/Issue.aspx"
New-SPTrustedIdentityTokenIssuer -Name "DevLeap Sample IP/STS" -Description "DevLeap Sample IP/STS" -Realm $realm -ImportTrustCertificate $cert -ClaimsMappings $map1,$map2,$map3
-SignInUrl $signinurl -IdentifierClaim $map1.InputClaimType

The script defines the $realm variable, which corresponds to the realm of the claims-consumer site. The value of this URL (/_trust/default.aspx, relative to the target SharePoint site) corresponds to a page that will be automatically added to the root folder of your SharePoint web application when you activate a trusted IP as an authentication technique. That page will be almost empty in terms of ASP.NET markup, and it will inherit its behavior from the page TrustedProviderSignInPage, defined in the Microsoft.SharePoint.IdentityModel.Pages namespace. This page will only redirect the user’s browser to the IP/STS logon page.

Another variable defined in the script is the URL of the logon page of the IP/STS ($signinurl). Finally, the script registers a new SPTrustedIdentityTokenIssuerNew-SPTrustedIdentityTokenIssuer. The arguments provided to this cmdlet in the previous example are for the name and description of the new IP, the realm of the target SharePoint site, the X.509 certificate of the IP/STS, and the sign-in URL, claims mappings, and type of the claim that will be considered as the identifier claim for the authenticated subject. instance by invoking the cmdlet

3.2 Configuring the target web application

To complete the configuration process, you need to add the new IP to the list of authentication providers for the target web application. On the SPCA page, in the Application Management section, click Manage Web Applications. A window appears that presents the list of all the available web applications. Choose the web application for which you want to enable the IP/STS as one of the authentication methods. Next, on the ribbon, click the Authentication Providers command. In the window that appears, click the Default Configuration hyperlink. The Edit Authentication configuration page opens, as shown in Figure 7. Here, you can select the new IP.

A screen shot showing the Edit Authentication page for configuring the type of authentication you want to support with a web application. It includes options for choosing Windows Authentication, Forms-Based Authentication (FBA), and federating with trusted IPs.

Figure 7. The Edit Authentication configuration page of SPCA.

That’s it! Now you’re ready to authenticate your users by using the custom IP/STS. Figure 8 shows the authentication options that are presented to any end user willing to authenticate.

A screen shot showing the default authentication page presented to the end users while logging on to a site in a web application supporting multiple authentication methods. There is a drop-down list for choosing the target authentication method. In the current sample, the available options are Windows Authentication, Forms Authentication, and DevLeap Sample IP/STS.

Figure 8. The authentication options displayed to the end user.

The DevLeap Sample IP/STS option will redirect the user to the logon page of the IP/STS. Of course, if you configure the IP as the unique authentication provider, your users will be redirected automatically to the IP/STS without stepping into the authentication method selection page.

Now you will also be able to configure users authenticated by the IP as specific SharePoint users and give them specific permissions. Figure 9 shows the Share dialog window, with a search result obtained by searching against the currently configured IP.

A screen shot showing the page for adding people and groups to SharePoint. The window provides IntelliSense support for looking through the available claims.

Figure 9. The Share window of SharePoint for adding people and groups.

If you try to access the sample site you defined in the “Building a relying party” section, you will be authenticated automatically and have access to the site. Thus, you are experiencing a real single-sign-on user experience.

 
Others
 
- Sharepoint 2013 : Claims-based authentication, federated identities, and OAuth (part 3) - Building a relying party
- Sharepoint 2013 : Claims-based authentication, federated identities, and OAuth (part 2) - Building an STS
- Sharepoint 2013 : Claims-based authentication, federated identities, and OAuth (part 1)
- Windows 8 : Printers and Devices - Start Screen Device Management
- Windows 8 : Printers and Devices - Desktop Printing
- Windows 8 : Desktop Printer and Device Installation
- Windows Small Business Server 2011 : Working with Groups
- Windows Small Business Server 2011 : Working with Computers (part 2) - Assigning Computers to Users
- Windows Small Business Server 2011 : Working with Computers (part 1) - Running the Connect Computer Program
- Windows Phone 8 : Using Push Notifications (part 6) - Handling Push Notification Errors
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
Technology FAQ
- Is possible to just to use a wireless router to extend wireless access to wireless access points?
- Ruby - Insert Struct to MySql
- how to find my Symantec pcAnywhere serial number
- About direct X / Open GL issue
- How to determine eclipse version?
- What SAN cert Exchange 2010 for UM, OA?
- How do I populate a SQL Express table from Excel file?
- code for express check out with Paypal.
- Problem with Templated User Control
- ShellExecute SW_HIDE
programming4us programming4us