Configuring Username Recovery¶
WSO2 Identity Server enables recovering user accounts where the user has forgotten the username. This is done by matching the user claims that are related to user attributes. The user will be prompted to enter values for these user attributes. If the value entered by the user matches with the claims, the corresponding username will be emailed to the user’s registered email ID.
Scenario¶
Pickup is a cab company that has many employees who use different credentials to sign in to different internal enterprise applications. Larry who is a new recruit at Pickup has forgotten the username.
Let's learn how Larry can recover the password by providing the corresponding profile information!
Set up¶
Follow the steps below to configure WSO2 Identity Server to enable username recovery.
-
Open the
deployment.toml
file in the<IS_HOME>/repository/conf
directory.-
Check whether the following listener configs are in place.
[event.default_listener.identity_mgt] priority= "50" enable = false [event.default_listener.governance_identity_mgt] priority= "95" enable = true
-
To configure the email server to send emails requesting password reset, add the following configurations.
- from_address: This is the email address from which the confirmation email will be sent.
- username: This is the username of the given email address.
- password: This is the password of the given email address.
[output_adapter.email] from_address= "" username= "" password= "" hostname= "smtp.gmail.com" port= 587 enable_start_tls= true enable_authentication= true
[output_adapter.email] from_address= "[email protected]" username= "wso2iamtest" password= "[email protected]" hostname= "smtp.gmail.com" port= 587 enable_start_tls= true enable_authentication= true
If you are using a Google email account
Google has restricted third-party applications and less secure applications from sending emails by default. As WSO2 Identity Server acts as a third-party application when sending emails for password entry, follow the steps below to enable your Google email account to provide access to third-party applications.
-
Under Signing in to Google section, turn off the 2-step Verification option.
-
Enable Less secure app access in the Google Account's Security section.
-
-
On the Main menu of the Management Console, click Identity > Identity Providers > Resident.
-
Under the Account Management section, click Account Recovery.
-
Select the following check boxes:
- Username recovery
- Manage notifications sending internally
-
Click Update.
Try out¶
-
To create the user account for Larry:
-
On the Main menu of the Management Console, click Identity > Users and Roles > Add.
-
Click Add New User.
-
Enter the required data as follows.
- Domain:
Primary
- Username:
Larry
- Domain:
-
Click Finish.
-
-
To assign login permissions to the user:
-
Click the View Roles option of Larry.
-
Click Permissions.
-
Select Login and click Update.
-
-
To add Larry's email Id:
-
Click User Profile option of Larry.
-
Enter an email address to which Larry's password recovery emails will be sent. Enter the first name as
Larry
. -
Click Update.
-
-
To mimic a forgotten username:
-
On the Sign In screen of the WSO2 Identity Server My Account at
https://localhost:9443/myaccount
, click Username. -
Enter the first name as
Larry
. -
Click Submit.
-
An email with the username is sent to the given email address.
-