Example of Setting Up Two-Factor Authentication

The below example uses the OpenSSL version for Microsoft Windows OS. It is supposed to use configuration with security server set up to IIS web server. The example shows steps for creating three certificates:

1. OpenSSL Presetting

The following OpenSSL settings were determined before executing the example:

  1. The dir parameter within the [CA_default] field is changed to C:/iis in the openssl.cnf configuration file.

  2. The C:\iis and C:\iis\newcerts folders are created.

  3. Two files are created in the C:\iis folder: index.txt that is empty, and the serial file without extension that contains 01 value.

2. Creating and Installing a Root Certificate

A root certificate is required to sign client and server certificates.

Creating a Root Certificate

To create a root certificate, open OpenSSL and enter the following in the command line:

req -new -x509 -days 1000 -out c:\iis\ca.crt -keyout c:\iis\ca.key -config openssl.cnf

Additional data is requested on executing the command: PEM password and certificate owner data.

TIP. If required, certificate's validity period can be changed in the command or in default OpenSSL settings.

Installing Created Certificate

The created certificate must be installed to trusted certification authorities storage:

  1. Open management console (WIN+R) by running the mmc command.

  2. Add (CTRL+M) the certificates snap-in for the local workstation account.

  3. Import the previously created certificate to the Trusted Root Certification Authorities > Certificates folder.

3. Creating and Installing a Server Certificate

A server certificate is used by IIS web server to check validity of user certificates; to create and sign a server certificate, execute the following steps:

Creating a Certificate Request

  1. Open a certificate setup page in IIS service manager by clicking the Server Certificates button.

  2. Select the Create Certificate Request item in the context menu or on the side panel.

  3. Fill in the fields with data about certificate owner.

  4. When it is requested to name the created file, save it in the C:\iis folder as server.csr.

Signing Certificate Request

The created request must be signed by means of the root certificate. Open OpenSSL console and execute the command:

ca -days 1000 -policy policy_anything -keyfile c:\iis\ca.key -cert c:\iis\ca.crt -in c:\iis\server.csr -out c:\iis\server.cer -config openssl.cnf

On executing the command it is requested to enter PEM password and answer follow-up questions. After the data is entered, a certificate is created.

Installing Server Certificate to IIS

The signed server certificate must be installed to IIS web server:

  1. Open a certificate setup page in IIS service manager by clicking the Server Certificates button.

  2. Select the Request Certificate Install item in the context menu or on the side panel.

  3. Specify the path to the signed certificate: C:\iis\server.cer.

As a result, the signed server certificate is installed to IIS web server.

4. Connection Parameter Settings

Adding https Binding

  1. Open the site page in the IIS service manager, for example, Default Web Site.

  2. Select the Bindings item in the context menu or on the side panel.

  3. Add a new binding: specify https in the Type box, select the previously created server certificate in the drop-down list.

SSL Settings

Enable SSL settings for the web site or application in use:

  1. Open a SSL settings setup page in the IIS service manager by clicking the SSL Settings button.

  2. Select the Require SSL checkbox and the Require Client Certificate radio button.

Setting Up Connection Parameters

On two-factor authentication the https protocol is used to connect to web service.

In the settings of user connection to security server specify URL of web service considering the security protocol:

https://<workstation>/fpSS_App_v9.2x64/axis2/services/PP.SOM.SomSec

On using BI server along with security server, set https connection at all steps.

5. Creating a Client Certificate

Creating a Client Certificate Request

To create a request, open OpenSSL console and execute the command:

req -new -days 1000 -keyout c:\iis\client.key -out c:\iis\client.csr -config openssl.cnf

On executing the command it is suggested to set PEM password and additional data about certificate owner.

After the data is entered, a key and a request for client certificate are created.

Signing Certificate Request

The created request must be signed by means of the root certificate. Open OpenSSL console and execute the command:

ca -days 1000 -policy policy_anything -keyfile c:\iis\ca.key -cert c:\iis\ca.crt -in c:\iis\client.csr -out c:\iis\client.cer -config openssl.cnf

On executing the command it is requested to enter PEM password and answer follow-up questions. After the data is entered, a certificate is created.

Saving Certificate in Container

To import a certificate to certificate storage with the key, convert the certificate with the key into a *.pfx. container.

Execute the command in OpenSSL console:

pkcs12 -export -inkey c:\iis\client.key -in c:\iis\client.crt -out c:\iis\client.pfx

On executing the command it is requested to enter PEM password.

After a container is created, pass it to the client workstation and import to the certificate storage.

6. Binding of Certificate to User

A certificate is bound to the particular user on the General Properties tab in user properties.

Select the From File item in the drop-down menu of the Add button and specify the created client certificate.

As a result, the user is allowed access to repository only on presenting the user certificate.

7. Checking Certificate Performance

Before checking certificate performance restart IIS web server.

To check if certificate requests work, check access to security server web service. Open the URL in the browser:

https://<workstation>/fpSS_App_v9.2x64/axis2/services

If everything is set correctly, a dialog box for selecting a certificate for site authentication opens.

If the certificate is correctly set, a page with available web service operations is displayed.

See also:

Setting Up Two-Factor Authentication | Example of Setting Up Two-Factor Authentication on Linux