# Setup: Authentication: SSO integration by using form authentication

**URL:** <https://discuss.workflowgen.com/t/setup-authentication-sso-integration-by-using-form-authentication/618>\
**Category:** Authentication\
**Created:** [October 30, 2015, 6:38am UTC](https://discuss.workflowgen.com/t/setup-authentication-sso-integration-by-using-form-authentication/618 "2015-10-30T06:38:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wfg-admin](https://yyz2.discourse-cdn.com/flex030/user_avatar/discuss.workflowgen.com/wfg-admin/32/714_2.png) [@wfg-admin](https://discuss.workflowgen.com/u/wfg-admin)\
**Post date:** [October 30, 2015, 6:38am UTC](https://discuss.workflowgen.com/t/setup-authentication-sso-integration-by-using-form-authentication/618/1 "2015-10-30T06:38:22Z")

</div>

WorkflowGen supports Single Sign-On integration with a tiered application. Two main technical solutions are possible: Form authentication or Custom HttpModule.

This article will focus on the Form authentication solution, but the code provided for this solution can be reused for a Custom HttpModule.

**Note about cookie access:** To have access to the remote app cookie the WorkflowGen website must be in a DNS subdomain of the remote app.

#### WorkflowGen Form authentication configuration

The first step is to configure WorkflowGen to use Form authentication. To do this:

1. [Download this file](https://app.box.com/s/kdifjsorjtgtxgv4471at3w4ltkoo82b), unzip it, and copy the `loginsso.aspx` file into the `\wfgen` folder.

2. Open the `\wfgen\web.config` file and copy the following code into the `<system.web>` node:

3. Change the authentication configuration in IIS as follows:

4. Check **Enable anonymous**.

5. Uncheck the other authentication methods for the following IIS applications:  

6. Edit `\wfgen\loginsso.aspx`. In the **Authentication** function, change the following variables according to your tier app:

#### Tier application configuration

1. Call WorkflowGen with the token:

2. Call the WorkflowGen login URL:

3. Manage authentication requests from WorkflowGen:

4. Manage sign-out requests done by the tier application to logout the user in WorkflowGen:

#### Encryption method

The example provided supports base64 encoding or encryption.

For the encryption option, `loginsso.aspx` uses 3DES mode ECB with MD5 to hash the private key by default. You can customize the `loginsso.aspx` code according to your requirements.

**PHP code example**

```auto
$key = 'mykey';
$string = 'string to be encrypted';
$encrypted = mcrypt_encrypt(MCRYPT_3DES, md5($key), $string, MCRYPT_MODE_ECB);

```
