007-012087-001 Microsoft ADFS Integration Guide RevE
007-012087-001 Microsoft ADFS Integration Guide RevE
Federation Services
Integration Guide
All information herein is either public information or is the property of and owned solely by Gemalto NV. and/or
its subsidiaries who shall have and keep the sole right to file patent applications or any other kind of intellectual
property protection in connection with such information.
Nothing herein shall be construed as implying or granting to you any rights, by license, grant or otherwise, under
any intellectual and/or industrial property rights of or concerning any of Gemalto’s information.
This document can be used for informational, non-commercial, internal and personal use only provided that:
• The copyright notice below, the confidentiality and proprietary legend and this full warning notice appear in
all copies.
• This document shall not be posted on any network computer or broadcast in any media and no modification
of any part of this document shall be made.
Use for any other purpose is expressly prohibited and may result in severe civil and criminal liabilities.
The information contained in this document is provided “AS IS” without any warranty of any kind. Unless
otherwise expressly agreed in writing, Gemalto makes no warranty as to the value or accuracy of information
contained herein.
The document could include technical inaccuracies or typographical errors. Changes are periodically added to
the information herein. Furthermore, Gemalto reserves the right to make any change or improvement in the
specifications data, information, and the like described herein, at any time.
Gemalto hereby disclaims all warranties and conditions with regard to the information contained herein,
including all implied warranties of merchantability, fitness for a particular purpose, title and non-infringement. In
no event shall Gemalto be liable, whether in contract, tort or otherwise, for any indirect, special or consequential
damages or any damages whatsoever including but not limited to damages resulting from loss of use, data,
profits, revenues, or customers, arising out of or in connection with the use or performance of information
contained in this document.
Gemalto does not and shall not warrant that this product will be resistant to all possible attacks and shall not
incur, and disclaims, any liability in this respect. Even if each product is compliant with current security
standards in force on the date of their design, security mechanisms' resistance necessarily evolves according to
the state of the art in security and notably under the emergence of new attacks. Under no circumstances, shall
Gemalto be held liable for any third party actions and in particular in case of any successful attack against
systems or equipment incorporating Gemalto products. Gemalto disclaims any liability with respect to security
for direct, indirect, incidental or consequential damages that result from any use of its products. It is further
stressed that independent testing and verification by the person using the product is particularly encouraged,
especially in any application in which defective, incorrect or insecure functioning could result in damage to
persons or property, denial of service or loss of privacy.
© 2016 Gemalto. All rights reserved. Gemalto and the Gemalto logo are trademarks and service marks of
Gemalto N.V. and/or its subsidiaries and are registered in certain countries. All other trademarks and service
marks, whether registered or not in specific countries, are the property of their respective owners.
Contents
Preface .................................................................................................................................. 5
Scope .................................................................................................................................................................... 5
Document Conventions ......................................................................................................................................... 5
Command Syntax and Typeface Conventions ............................................................................................... 6
1 Introduction ...................................................................................................................... 7
Overview................................................................................................................................................................ 7
Understanding the Active Directory Federation Services ..................................................................................... 7
3rd Party Application Details ........................................................................................................................... 8
Supported Platforms.............................................................................................................................................. 8
Windows Server 2008 R2 ............................................................................................................................... 8
Windows Server 2012 R2 ............................................................................................................................... 8
Prerequisites.......................................................................................................................................................... 9
SafeNet Network HSM Setup ......................................................................................................................... 9
Microsoft ADFS Setup .................................................................................................................................... 9
4 Integrating Microsoft Active Directory Federation Services 3.0 with SafeNet Luna HSM 40
Configuring Active Directory Certificate Services with SafeNet Luna HSM ........................................................ 40
SafeNet Luna HSM for Active Directory Federation Services ............................................................................. 41
Preface
This document guides security administrators on obtaining the necessary information to install, configure, and
integrate Microsoft ADFS with SafeNet Luna HSM. This document outlines the steps to integrate Microsoft
ADFS with SafeNet Luna HSM.
Scope
This guide provides instructions for setting up a small test lab with Active Directory Federation Services (ADFS)
2.0 with Windows Identity Foundation (WIF) on a server running the Windows Server 2008 R2 operating system
and using SafeNet Luna HSM for securing the Token Signing/Decrypting certificate private keys. It explains how
to install and configure software that is required for setting up a federation server (running ADFS 2.0 software)
and a Web server (running WIF software) while storing certificate keys on SafeNet Luna HSM.
Document Conventions
This section provides information on the conventions used in this template.
Notes
Notes are used to alert you to important or helpful information. These elements use the following format:
Cautions
Cautions are used to alert you to important information that may help prevent unexpected results or data loss.
These elements use the following format:
CAUTION: Exercise caution. Caution alerts contain important information that may
help prevent unexpected results or data loss.
Warnings
Warnings are used to alert you to the potential for catastrophic data loss or personal injury. These elements use
the following format:
WARNING: Be extremely careful and obey all safety and security measures. In
this situation you might do something that could result in catastrophic data loss or
personal injury.
italic The italic attribute is used for emphasis or to indicate a related document. (See the
Installation Guide for more information.)
1
Introduction
Overview
SafeNet Luna HSM integrates with Microsoft ADFS to provide significant performance improvements by off-
loading cryptographic operations from the ADFS Server to the SafeNet Luna HSM. In addition, SafeNet Luna
HSM provides extra security by protecting and managing the server’s high value SSL private key within a FIPS
140-2 certified hardware security module.
Active Directory Federation Services (ADFS) is a software component developed by Microsoft that can be
installed on Windows Server operating systems to provide users with single sign-on access to systems and
applications located across organizational boundaries. It uses a claims-based access control authorization
model to maintain application security and implement federated identity.
Claims-based authentication is the process of authenticating a user based on a set of claims about its identity
contained in a trusted token. Such a token is often issued and signed by an entity that is able to authenticate the
user by other means, and that is trusted by the entity doing the claims based authentication.
In ADFS, identity federation is established between two organizations by establishing trust between two security
realms. A federation server on one side (the Accounts side) authenticates the user through the standard means
in Active Directory Domain Services and then issues a token containing a series of claims about the user,
including its identity. On the other side, the Resources side, another federation server validates the token and
issues another token for the local servers to accept the claimed identity. This allows a system to provide
controlled access to its resources or services to a user that belongs to another security realm without requiring
the user to authenticate directly to the system and without the two systems sharing a database of user identities
or passwords.
controlled access to its resources or services to a user that belongs to another security realm without requiring
the user to authenticate directly to the system and without the two systems sharing a database of user identities
or passwords.
Supported Platforms
Windows Server 2008 R2
Third Party Application Luna Client Software SafeNet Luna HSM Appliance
Version Software & Firmware Version
Third Party Application Luna Client Software SafeNet Luna HSM Appliance
Version Software & Firmware Version
Prerequisites
SafeNet Network HSM Setup
Refer to the SafeNet Network HSM documentation for installation steps and details regarding configuring and
setting up the box on Windows systems. Before you get started, ensure the following:
1. SafeNet Network HSM appliance and a secure admin password
2. SafeNet Network HSM, and a hostname, suitable for your network
3. SafeNet Network HSM network parameters are set to work with your network
4. Initialize SafeNet Network HSM.
5. Create and exchange certificates between SafeNet Network HSM and Client system.
6. Create a partition on SafeNet Network HSM. Remember the partition password that will be later used by
Microsoft ADFS. Register the client with the partition. Run the "vtl verify" command on the client system to
display a registered partition. The general form of command for Windows is C:\Program
Files\SafeNet\LunaClient > vtl verify.
7. Enable partition policies 22 and 23: Activation and Auto Activation respectively.
2
Integrating Microsoft Active Directory
Federation Services
4. Double-click Register Or View Security Library on the left side of the pane.
5. Browse the library cryptoki.dll from the SafeNet Luna HSM client installation directory and click Register.
9. Click Register Slot to register the slot for Domain\User. On successful registration, a message 'The slot
was successfully and securely registered' displays.
5. Right-click Roles and then click, Add Roles. The Add Roles wizard displays.
6. Click Next.
7. Select the Active Directory Certificate Services check box from Server Roles to install on this server.
8. Click Next.
10. Select the Certification Authority check box from the Role services list to install Active Directory
Certificate Services.
12. Select the type of setup on the Specify Setup Type page.
16. Proceed to setup the Private Key for CA to generate and issue certificates to clients. Select Create a new
private key.
18. To create a new private key, you must select a cryptographic service provider and key length. Select
algorithm for SafeNet Key Storage Provider from the select a cryptographic service provider (CSP)
drop-down menu.
19. Select the Hash Algorithm for signing certificates issued by the Certificate Authority and key length settings
for your installation.
20. Select the 'Allow administrator interaction when the private key is accessed by the CA' check box.
26. Configure the Certificate Database. It records all certificate requests, issued certificates, and revoked or
expired certificates.
29. Click Install to install the selected roles, role services, or features.
30. Click Close to exit the Add Roles wizard after viewing the installation results.
5. In the Add or Remove Snap-Ins dialog box, select the Certificates Templates snap-in under the
Available snap-ins menu.
6. Click Add, and then click OK.
7. Under Console Root, expand the Certificate Templates snap-in. Listed in the middle section will be all the
available certificate templates that you can make your CA issue.
8. Scroll down the list until you locate the Web Server template, right-click and click Duplicate Template.
9. Select Windows Server 2003 Enterprise and click OK.
10. A pop-up dialog box displays. Click the General tab.
11. Enter the Template Display Name for example ADFS..
12. Click the Request Handling tab.
13. Click on CSPs and select Request can use any CSP available on subject’s computer.
14. Click OK to close the window.
15. Click the Security tab and click Add.
16. Type NETWORK SERVICE and click OK.
17. Click NETWORK SERVICE in the Group or user names area.
18. In the Permissions area, Ensure that the Read and Enroll check boxes are ticked.
19. Add and provide the Read and Enroll permissions to the following members:
• Domain Computers
• Domain Controllers
• NETWORK SERVICE
• IIS_IUSRS
20. For Domain Admins and Enterprise Admins, ensure that the Read, Write, and Enroll check boxes are
ticked.
21. Click Apply and then OK.
Register CSP
1. CSP must be installed on the Federation Services (ADFSWEB).
2. Open the command prompt and navigate to <SafeNet Luna HSM installation directory>\CSP.
3. Run the register.exe and provide the SafeNet Luna HSM partition password to register the partition with
CSP.
10. Click Finish, it will generate the certificate request. Submit certificate request to CA and save the signed
certificate.
11. In the IIS Action pane, click Complete Certificate Request.
12. Browse and select the CA signed certificate and enter the Friendly Name as ADFS Server Certificate.
13. Click OK to complete the certificate request and close the window.
14. In the console tree, click the root node that contains the name of the computer, click Default website.
15. In the Actions pane, click Bindings.
16. In the Site Bindings dialog box, click Add.
17. In the Add Site Binding dialog box, select https in the Type drop-down list, select the certificate that you
have generated through IIS in the SSL certificate drop-down list, click OK, and then click Close.
18. Close the Internet Information Services (IIS) Manager console.
3
Install and Configure WIF and Sample
Application
This chapter lists down the steps to install and configure WIF and a sample application (provided by the WIF
SDK) to trust the claims that are issued by the federation server role that you created in the previous chapter.
After this step is complete, the ADFSSRV computer is set up in both the federation server role and the claims-
aware Web server role.
You can refer the following Microsoft Documentation for setting up Windows Identity Foundation SDK to verify
the claim based application:
http://technet.microsoft.com/en-us/library/adfs2-federation-wif-application-step-by-step-
guide%28v=ws.10%29.aspx
NOTE: Verify that the Uniform Resource Identifier (URI) starts with https and
that it does not specify a port number. For example:
https://ADFSWEB.integration.com/ClaimsAwareWebAppWithManagedSTS/
5. On the Security Token Service page, click Use an existing STS, type https://<fully qualified domain
name>/federationmetadata/2007-06/federationmetadata.xml, and then click Next.
6. On the Security token encryption page, click Enable encryption.
7. Click Select an existing certificate from store and then click Select Certificate.
8. Click and select ADFS Token Signing certificate generated by Luna CSP, click OK and then click Next.
9. On the Offered claims page, review the claims that will be offered by the federation server, and then click
Next.
10. On the Summary page, review the changes that will be made to the sample application by the Federation
Utility Wizard, and then click Finish.
11. A message You have successfully configured your application displays. Click OK.
3. On the Select Data Source page, click Import data about the relying party published online or on a local
network, type https://<fully qualified domain name>/ClaimsAwareWebAppWithManagedSTS/, and then click
Next. This action prompts the wizard to check for the metadata of the application that the Web server role
hosts.
4. On the Specify Display Name page, in Display name type WIF Sample App, and then click Next.
5. On the Choose Issuance Authorization Rules page, click Permit all users to access this Relying Party,
and then click Next.
6. On the Ready to Add Trust page, review the relying party trust settings, and then click Next to save the
configuration.
7. Click Close to exit. The Edit Claim Rule window displays.
4
Integrating Microsoft Active Directory
Federation Services 3.0 with SafeNet Luna
HSM
Register CSP
1. CSP must be installed on the Federation Services (ADFSWEB) in a separate step following completion of
the main Luna Client software installation.
2. Open the command prompt and navigate to <SafeNet Luna HSM installation directory>\CSP.
3. Run the register.exe and provide the SafeNet Luna HSM partition password to register the partition with
CSP.
4. Now execute the following command:
<SafeNet Luna HSM installation directory>\CSP >register.exe /l
4. Click OK. Ensure that Domain Administrator is added in the Group or User Name list.
5. Select the domain administrator and select the Full Permission check box.
6. Click Apply and then OK to close the window.
13. Click OK to complete the certificate request and close the window.
14. In the console tree, click the root node that contains the name of the computer, click Default website.
15. In the Actions pane, click Bindings.
16. In the Site Bindings dialog box, click Add.
17. In the Add Site Binding dialog box, select https in the Type drop-down list, select the certificate that you
have generated through IIS in the SSL certificate drop-down list, click OK, and then click Close.
18. Close the Internet Information Services (IIS) Manager console.
4. In the Name box, type the name to use for your AD FS farm. i.e. ADFSWEB
5. In the IP address box, type the IP address of your federation server. Click Add Host.
6. Right-click the domain_name node, and then click New Alias (CNAME).
7. In the New Resource Record dialog box, type enterpriseregistration in the Alias name box.
8. In the fully qualified domain name (FQDN) of the target host box, type
federation_service_farm_name.domain_name.com, i.e. ADFSWEB.contoso.com and then click OK.
9. Open the command prompt and then run ipconfig /flushdns on domain controller and also the ADFS
Server.
2. You can also browse to the AD FS sign-in page where your federation service name is appended with
adfs/ls/idpinitiatedsignon.htm, for example, https://adfsweb.contoso.com/adfs/ls/idpinitiatedsignon.htm.
This entry displays the AD FS sign-in page where you can sign in by using domain administrator credentials.
NOTE: Ensure to configure your browser settings to trust the federation server
role by adding your federation service name, for example,
https://adfsweb.contoso.com, to the browser’s local intranet zone.
5
Configure Multiple ADFS Instances Using
Same Key Pair on HSM
This chapter describes how to set up small test lab for multiple ADFS instances which will use the same keys on
the HSM for encryption\decryption of tokens issued by ADFS.
Register CSP
CSP must be installed on the Federation Servers (ADFS1 and ADFS2) in a separate step following completion
of the main SafeNet Luna HSM Client software installation.
Refer to Chapter two for installation steps of Luna CSP.
NOTE: The Object Type: Data is the key container for the ADFS keys; copy the
Object Label of the container i.e. “le-aa48606f-252d-4753-9e7c-26cbcb11baa9”.
This container will be used to associate the certificate with the same key pair on
ADFS2.
26. Submit the certificate request and obtain signed certificate from the Certificate Authority such as, VeriSign,
GlobalSign, etc. You can also use local CA to sign the certificate request.
a. In the Certificate Console, right-click on the Personal folder and select All Tasks > Import and follow
the instruction to import the Token Signing Certificate signed by CA.
b. You will get a message 'Certificate imported successfully'. Double-click on the certificate and verify
that “You have a private key that corresponds to this certificate.”
Now follow the steps of Chapter two from section “Configure ADFS to use SafeNet Luna HSM” to complete
the integration on ADFS1.
[Properties]
11 = "“; Add friendly name property
2 = "{text}”; Add Key Provider Information property
_continue_="Container=le-aa48606f-252d-4753-9e7c-26cbcb11baa9&"
_continue_="Provider=Luna enhanced RSA and AES provider for Microsoft Windows&"
_continue_="ProviderType=24&"
_continue_="Flags=32&"
_continue_="KeySpec=1"
Subject:
CN=ADFSTokenSigning
OU=TestToken
O=ADFSwithHSM
L=MYCity
S=MYState
C=IN
0070 14 f9 e9 69 3b 1d 46 f5 bd 56 53 ca 33 a8 5b 0e
0080 5c 52 c5 4d 3e e3 a4 11 35 2d 43 82 64 49 aa 7e
0090 2a bc fb dc b3 0a 56 74 84 d5 61 b0 28 db 13 11
00a0 5f 78 85 ab 5a c2 b8 84 8d f3 9d af 63 26 68 03
00b0 f0 83 08 be bd 8d ce 8b 40 17 4b 87 19 96 09 27
00c0 da 20 0a f9 70 4d 59 e3 97 f5 9a 8e 01 ef 1e f4
00d0 01 1e de 67 a4 06 10 fc 98 da 3b 3f 7d cd e5 3c
00e0 5b 1e ad d4 04 99 20 35 2f ec b9 e4 7a 82 1b f7
00f0 4b 3d 3a 86 37 03 75 8c 78 30 06 90 10 c8 6b c8
0100 6e 14 7f f9 65 c9 81 04 91 02 03 01 00 01
Certificate Extensions: 7
2.5.29.14: Flags = 0, Length = 16
Subject Key Identifier
7b 75 de c6 26 9e a2 1f e9 18 04 60 24 2f 31 36 ff da 19 e9
URL=ldap:///CN=contosoCA,CN=CA,CN=CDP,CN=Public%20Key%20Services,CN=Services,CN=Configuration,DC
=contoso,DC=com?certificateRevocationList?base?objectClass=cRLDistributionPoint
URL=ldap:///CN=contosoCA,CN=AIA,CN=Public%20Key%20Services,CN=Services,CN=Configuration,DC=conto
so,DC=com?cACertificate?base?objectClass=certificationAuthority
Signature Algorithm:
Algorithm ObjectId: 1.2.840.113549.1.1.5 sha1RSA
Algorithm Parameters:
05 00
Signature: UnusedBits=0
0000 76 a1 7d 4d 13 6c fd e3 13 e2 0d e4 ea 5d 85 ff
0010 1e a8 81 68 5c d9 7b ad e5 69 d9 b3 82 0a cf 3b
0020 7d bf e2 52 22 ce 38 ef e8 57 fc eb 3e ca af e4
0030 09 6b d1 22 2a e3 9f b6 e1 d6 33 55 9a 93 d9 2e
0040 df f6 33 d9 ae 06 63 b3 f9 0c a9 2e e8 34 e4 14
0050 d8 51 b8 6b 6e 62 13 85 a5 d7 f6 81 98 42 11 b3
0060 05 25 cc 29 5b cc 42 1a 4c 40 36 4f 93 87 0a 5b
0070 e4 08 38 8d 1e 54 d4 48 0a b3 a9 3f 90 61 1b 7b
0080 e2 68 f6 50 fe a9 c9 6b 58 0d 5b c2 ee 48 02 fb
0090 3e 1a b1 f1 c1 ea bb 5b e0 f3 52 9b 83 75 85 44
00a0 7e a4 26 ad ed 55 9c 7b c2 dc 83 ee 42 42 e5 82
00b0 c1 a7 fd 41 14 cf c1 fd 6b e5 bc 53 e6 f7 76 be
00c0 f8 f1 40 6d a4 66 24 77 4e a1 c3 f6 73 22 c6 c9
00d0 6b 3a f8 c4 3f 3c 7c 34 91 2f 84 ad 34 ad a6 c4
00e0 b3 d8 3d a4 20 c9 60 53 ee f8 a2 97 c8 b5 53 44
00f0 7e 80 b5 77 97 36 a2 8f ae 63 05 d8 c1 5b 55 52
Non-root Certificate
Key Id Hash(rfc-sha1): 7b 75 de c6 26 9e a2 1f e9 18 04 60 24 2f 31 36 ff da 19 e9
Key Id Hash(sha1): 6c 9d ea de 6a 39 ba c8 98 9b 9a 29 51 d3 75 24 fa 34 73 a5
Cert Hash(md5): 49 b1 d3 52 08 c1 ca 51 c3 c3 78 1a 8f 83 46 49
Cert Hash(sha1): da 9e 7e 8b 0f 7f 42 1b 46 b3 53 bb 22 63 48 ed 38 ee d5 c3
CERT_KEY_PROV_INFO_PROP_ID(2):
Key Container = le-aa48606f-252d-4753-9e7c-26cbcb11baa9
Provider = Luna enhanced RSA and AES provider for Microsoft Windows
ProviderType = 18
Flags = 20
KeySpec = 1 -- AT_KEYEXCHANGE
CERT_REQUEST_ORIGINATOR_PROP_ID(71):
ADFS2.contoso.com
CERT_ISSUER_PUBLIC_KEY_MD5_HASH_PROP_ID(24):
a4 61 ff d3 e8 45 60 6e 12 7a 5c 20 89 4f f6 0e
CERT_SUBJECT_PUBLIC_KEY_MD5_HASH_PROP_ID(25):
47 b9 ad b9 21 0f 01 22 91 8b 75 9e dd 37 22 6e
CERT_KEY_IDENTIFIER_PROP_ID(20):
7b 75 de c6 26 9e a2 1f e9 18 04 60 24 2f 31 36 ff da 19 e9
CERT_SIGNATURE_HASH_PROP_ID(15):
41 2a 3a f9 17 67 13 cf b9 a5 84 8e 45 8a c0 b8 dc bc 4f 28
CERT_MD5_HASH_PROP_ID(4):
49 b1 d3 52 08 c1 ca 51 c3 c3 78 1a 8f 83 46 49
CERT_SHA1_HASH_PROP_ID(3):
da 9e 7e 8b 0f 7f 42 1b 46 b3 53 bb 22 63 48 ed 38 ee d5 c3
CertUtil: -repairstore command completed successfully.
16. After completing the command, right-click on certificate in the console and click Properties.
17. In the General tab, type ADFS Token in the Friendly name text box. Click OK to close the Properties
window.
18. Right-Click on the certificate and click Open.
19. Ensure that the certificate displays the text “You have a private key that corresponds to this certificate”.
20. Click OK to close the certificate window.
21. At the command prompt, type certutil –verifystore My “Thumbprint” and press the Enter key.
22. Ensure that the command result states that the Certificate is Valid and shows Encryption test passed. Now
the certificate is ready to use as a Token Signing Certificate for ADFS2.
23. Close the Command Prompt window
24. Close all the open windows and restart the server.
After successful restart, log on to the ADFS2 server as a domain administrator and follow the steps of Chapter
two from section “Configure ADFS to use SafeNet Luna HSM” to complete the integration on ADFS2.
You can configure more ADFS instances like ADFS2 node to use the same key pair on HSM using the steps
provided above.