Monday Sep 28, 2009
Configuring Self Unlock After Account Lockout Using OpenSSO and Identity Manager is Fun
User account lockout in OpenSSO can happen in either of the following ways:
- Memory account lockout occurs when the user has exceeded the allowed number of failed attempts to log in as configured in the password policy. The user may remain locked out for a set period of time and can only reset the password after that period has passed. The locked state of the user account is maintained in memory and no information is written to the user's LDAP profile.
- Physical account lockout occurs when the status of a specified LDAP attribute in the user’s profile is explicitly changed to Inactive, either by an administrator or as a result of some automated processes. (The specified LDAP attribute is defined as the value of the Lockout Attribute Name attribute in the Core authentication module.) By default it is
inetuserstatus.
Configuring the LDAP Directory Server
For this procedure to work it is assumed that a password policy has been configured and assigned to the test user's LDAP profile in the directory server. The password policy should have the following controls set:- Enable Account Lockout (LDAP attribute:
passwordLockout) - Failures Before Lockout (LDAP attribute:
passwordMaxFailure) - Failure Count Reset (LDAP attribute:
passwordResetFailureCount) - Set Limit on Lockout Duration (LDAP attribute:
passwordUnlock) - Lockout Duration (LDAP attribute:
passwordLockoutDuration)
passwordPolicySubentry attribute in the test user's LDAP profile should also be defined with the DN of the password policy to denote that the password policy has been assigned. See the documentation for your specific directory for instructions on how to do these configurations.
Configuring OpenSSO
The OpenSSO LDAP authentication module supports the account lockout controls enforced by most directory servers. The following sections contain OpenSSO configurations.- To Enable LDAP Authentication
- To Define Identity Manager URLs as Not Enforced
- Modifying the OpenSSO Login Page
- Modifying the OpenSSO Account Lockout Message Page
To Enable LDAP Authentication
- Login to the OpenSSO console as administrator.
- Click the Access Control tab.
- Click the appropriate realm name.
- Click the Authentication tab.
- Click New in the Authentication Chaining section to create a new authentication chain.
- Enter a name for the chain and click OK.
For this example use idmauth. - On the new chain's Properties page, add the LDAP module as REQUIRED and click Save.
- Click Back to Authentication.
- Select the service just created as the value for Organization Authentication Configuration.
- Save the changes.
- Logout from the OpenSSO console.
/opensso/console to log in to the OpenSSO console (not /opensso/UI/Login) to ensure that the authentication module configured for the OpenSSO administrator is used and not the LDAP module just configured.
To Define Identity Manager URLs as Not Enforced
- Login to the OpenSSO console as administrator.
- Click the Access Control tab.
- Click the appropriate realm name and navigate to the Agents profile for the policy agent that protects Identity Manager.
- Under the agent profile, click the Application tab.
- Add the following URIs to the Not Enforced URIs property.
/idm/authutil//idm/authutil/*/idm/authutil/*?*
- Click Save.
- Logout of OpenSSO.
Modifying the OpenSSO Login Page
This procedure documents how to modifyLogin.jsp with the necessary code for this use case. The code will save the value of the goto parameter in the HTTP request. This saved URL is required by the user_inactive.jsp created in the next procedure. The saved URL (which is the original location desired by the user) will be passed to Identity Manager and used to redirect the user after unlocking has been completed.
There are two options to consider when deciding how to embed code into the OpenSSO Login.jsp. You can manually change the deployed Login.jsp file, or you can use the sample Login.jsp included with the opensso.zip download. They are mutually-exclusive so choose only one of these procedures.
To Manually Modify a Deployed Login.jsp
- Change to the
/web-container-deploy-base/opensso/config/auth/default/directory to access the deployedLogin.jsppage. - Open
Login.jspin an editor and add the two (2) sections of code displayed in yellow in account_unlock_login.html on the OpenSSO web site. - Remove the web containers temporary, compiled JSP to ensure that the changes made are picked up.
For example, if using Glassfish, the temporary, compiled classes can be found underglassfish-home/domains/your-domain/generated/. - Restart the OpenSSO web container after making the changes.
To Use the Sample Login.jsp
- Change to the
opensso/integrations/idm/jsps/directory in the decompressedopensso.zipto access the sampleLogin.jsp. - Change the Identity Manager URL embedded in the sample
Login.jspto reflect the Identity Manager system URL of your architecture.
You can search for the string/idmto locate the URLs. - Replace your deployed
/web-container-deploy-base/opensso/config/auth/default/Login.jspwith the sampleLogin.jsp.
If you replace your existingLogin.jspwith the sampleLogin.jspthe following will occur.- You will lose any custom changes made to the existing
Login.jsp. - You will inherit changes that might have been previously made to the sample
Login.jspto incorporate requirements for other use cases related to the OpenSSO integration with Identity Manager.
- You will lose any custom changes made to the existing
- Remove the web containers temporary, compiled JSP to ensure that the changes made are picked up.
For example, if using Glassfish, the temporary, compiled classes can be found underglassfish-home/domains/your-domain/generated/. - Restart the OpenSSO web container after making the changes.
diff between both files and make the necessary changes manually.
Modifying the OpenSSO Account Lockout Message Page
This procedure documents how to modifyuser_inactive.jsp, the JSP that notifies the user that the account is locked. You will modify the page to include a redirect to an Identity Manager page that will enable the user to unlock the account. user_inactive.jsp will forward the following information to Identity Manager:
- The original URL requested by the user and defined as the value of the
gotoparameter. - The user identifier defined as the value of the
accountIdparameter
user_inactive.jsp. You can manually change the deployed user_inactive.jsp file, or you can use the sample user_inactive.jsp included with the opensso.zip download. They are mutually exclusive so choose only one of these procedures.
To Manually Modify the Account Lockout Message Page
- Change to the
/web-container-deploy-base/opensso/config/auth/default/directory to access the deployeduser_inactive.jsppage. - Open
user_inactive.jspin an editor and add the two (2) sections of code displayed in yellow in account_unlock_inactive.html on the OpenSSO web site.
Embedded in the JSP, you will see the URL to the Identity Manager page that allows the account unlock. You should modify this URL as per your deployment. - Remove the web containers temporary, compiled JSP to ensure that the changes made are picked up.
For example, if using Glassfish, the temporary, compiled classes can be found underglassfish-home/domains/your-domain/generated/. - Restart the OpenSSO web container after making the changes.
anonResetPassword.jsp. You might, however, direct the user to questionLogin.jsp, the forgotten password page because if a user has accidentally locked an account it may be because of a forgotten password.
To Use the Sample Account Lockout Message Page
- Change to the
opensso/integrations/idm/jsps/directory in the decompressedopensso.zipto access the sampleuser_inactive.jsp. - Change the Identity Manager URL embedded in the sample
Login.jspto reflect the Identity Manager system URL of your architecture.
You can search for the string/idmto locate the URLs. - Replace your deployed
/web-container-deploy-base/opensso/config/auth/default/user_inactive.jspwith the sampleuser_inactive.jsp.
If you replace your existinguser_inactive.jspwith the sampleuser_inactive.jspthe following will occur.- You will lose any custom changes made to the existing
Login.jsp. - You will inherit changes that might have been previously made to the sample
Login.jspto incorporate requirements for other use cases related to the OpenSSO integration with Identity Manager.
- You will lose any custom changes made to the existing
- Remove the web containers temporary, compiled JSP to ensure that the changes made are picked up.
For example, if using Glassfish, the temporary, compiled classes can be found underglassfish-home/domains/your-domain/generated/. - Restart the OpenSSO web container after making the changes.
diff between both files and make the necessary changes manually.
Testing The Configurations
The following procedures document testing these configurations for memory account lockout and physical account lockout.To Test Memory Account Lockout
- Configure the password policy and assign the policy to the test user.
This is done using the user data store. - Access a resource protected by OpenSSO to get redirected to the login page.
- Login to OpenSSO using an incorrect password.
Do this consecutively until the account gets locked and the error page is displayed. This will be dependent on the number of attempts configured in the password policy. - Click the hyperlink on the page.
You will be redirected to an Identity Manager page on which you will be required to change your password. Note that the URL is the one configured in theuser_inactive.jsp. - Change your password.
Identity Manager determines the account from theaccountIDparameter and will change the password on both OpenSSO and Identity Manager. After a successful modification, the user will be redirected to the original URL defined in thegotoparameter.
To Test Physical Account Lockout
- Set the value of the
inetuserstatusattribute in the test user's profile in the user data store to Inactive. - Access a resource protected by OpenSSO to get redirected to the login page.
- Login to OpenSSO.
An error page will be displayed informing you that the account has been locked. - Click the hyperlink on the page.
You will be redirected to an Identity Manager page on which you will be required to change your password. Note that the URL is the one configured in theuser_inactive.jsp. - Change your password.
Identity Manager determines the account from theaccountIDparameter and will change the password on both OpenSSO and Identity Manager. After a successful modification, the user will be redirected to the original URL defined in thegotoparameter.
Posted at 12:00AM Sep 28, 2009 by Michael Teger in Sun | Comments[5]

Hi,
In the release build of Identity Manager 8.1.0.0, I don't see an /idm/authutil/ path, nor do I see an anonResetPassword.jsp path. What version of Identity Manager were these instructions written for?
Posted by Michael Robinson on September 28, 2009 at 06:37 PM PDT #
Thanks for pointing out the missing info, Michael. I added the version number to this article and the other related ones recently published here: IDM 8.1.0.5.
Posted by Michael Teger on September 29, 2009 at 07:47 AM PDT #
And where would one get that from? I can see the 8.1 patch 4 patch on SunSolve, but not patch 5...
Posted by Michael Robinson on September 29, 2009 at 03:19 PM PDT #
One would have to wait...oy gevalt. I just heard that the release was delayed until the third week in October. Sorry, Michael. I've added this info to the blog and will keep you posted if I hear anything else.
Posted by Michael Teger on September 30, 2009 at 09:27 AM PDT #
I figured it'd be something like that.
Eh, if y'all have been writing something like /authutil/anonResetPassword.jsp, have you ensured that the request for a password reset can *only* come from OpenSSO? Otherwise there's a bit of a security leak.
Or does the poor user have to present their password again?
Posted by Michael Robinson on October 01, 2009 at 01:13 AM PDT #