In a scenario where an OpenAM Data Store has been configured so that the search attribute is different from the authentication attribute, for example:
...then using the Self Service 'Forgot Username' functionality will send an email to the end-user containing a username based on the CN. However in this case this is not the same as the 'username' that is used to login which means that the response is invalid in this scenario and the end-user can't make use of this information.
1). Setup OpenAM, configure email and create a test user that has a UID that is different to the CN.
2). Adjust the DataStore as described in the problem description.
3). Enable the 'Forgotten Username' self-service option in OpenAM and then test this so that an email is sent to the test user. Note that the username in the email is based on the CN value.
The Forgot Username configuration needs to be able to return a different attribute for the "username".