User self-registration allows end-users to create their own accounts for login to your application. You can require them to answer a CAPTCHA to prevent automated processes from creating accounts and can also require users to confirm their email address by visiting a link sent to the email address they provide during registration.
- Currently, user self-registration is only supported for LDAP and SQL-based directories.
- For LDAP-based directories, the “Generic User” account on the “LDAP Basic” tab must have authority to create Users in the target directory.
- CAPTCHA functionality requires a reCAPTCHA API key from Google
- Microsoft SQL Server 2005 or later is required for the email confirmation feature. The user’s registration data is temporarily stored there until confirmation or it expires.
Follow the steps below to enable and configure user self-registration:
- If using CAPTCHA:
- Register for a reCAPTCHA API key
- Enter the Public and Private keys in the Services -> CAPTCHA tab of the PG Bootstrap Configuration using PG_Config.exe
- If using email confirmation:
- Copy PortalGuard’s SQL scripts to the SQL server machine. The script files are found in the PG kit under the folder:
PortalGuard\For IIS\_Optional\SQL scripts
- On the SQL server, run the PG scripts in the following order:
- On the PG server, create a new ODBC connection to the SQL server from Start -> Administrative Tools -> Data Sources (ODBC). This must be a System DSN.
- In PG_Config.exe, set the SQL connectivity settings in the Bootstrap under the User Data -> SQL tab:
- Also in the Bootstrap, configure email/SMTP server settings on the Services -> Email tab.
- In IIS Manager, right-click the root of the PortalGuard website and choose “Add Virtual Directory…”
- Set the alias as “reg” and the physical path as “C:\inetpub\PortalGuard\_layouts\PG”
- In PG_Config.exe, edit the User Repository configuration and enable Self-Registration on the Self Registration tab.
- On the Basics sub-tab, either the Username or Email Address should be checked for uniqueness (or both).
- On the User Creation sub-tab, set the Target Container in LDAP and click the “Set Defaults” button to establish the default field mappings. This controls how the HTML fields will be set in the user’s account.
- If using email confirmation, the email template and the lifespan of the staged registration data can be customized on the Email Confirmation sub-tab.
- Save the changes to the User Repository configuration.
- Optionally, you can edit “C:\InetPub\PortalGuard\_layouts\PG\register.aspx” to customize the look and feel of the registration form. You can also add additional fields but renaming any existing HTML input fields is not supported.
- Optionally, you can edit the ProcessRequest function in “C:\InetPub\PortalGuard\App_Code\register.ashx.cs” to do any custom work when a user is successfully registered.
You can now direct users to the following page to initiate the registration process: