User Registration with Email Verification¶
In this approach, an administrator first creates a user account with a default password that will be emailed to the user's registered email Id for confirmation.
Pickup is a cab company that has many employees who use different credentials to sign in to different internal enterprise applications. While Sam is an administrator at Pickup, Alex is a new recruit.
Sam wants to register a user account with a default password for Alex and get it activated by requesting Alex to verify.
Let's learn how it's done!
Follow the steps below to configure WSO2 Identity Server to enable password entry for account confirmation.
deployment.tomlfile in the
To request email verification from the users who are registered with a default password, add the following configurations.
[identity_mgt.user_onboarding] enable_email_verification = true lock_on_creation=true
To configure the email server to send emails requesting a password entry, add the following configurations.
- from_address: This is the email address from which the confirmation email will be sent.
- username: This is the user name 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@example.com" username= "wso2iamtest" password= "Wso2@iam70" 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.
Sign in to the WSO2 Identity Server Management Console at
https://<SERVER_HOST>:9443/carbonas an administrator.
On the Main menu of the Management Console, click Identity > Identity Providers > Resident.
Under the Account Management Policies section, click User Onboarding.
Select the Enable User Email Verification check box.
You may enter the confirmation email validity period (in minutes) in the Email verification code expiry time text box.
You have now configured WSO2 Identity Server to send the user account confirmation email to the registered user. Let's try it out!
To create the user account for Alex, execute the following cURL.
Make sure to enter a valid user email.
Using special characters in the username
Note that the special characters
>, and whitespaces are not allowed in usernames as they have been reserved for other purposes. See Usernames in WSO2 Identity Server for more information on this.
An email requesting to confirm the user creation is sent to the given email address.
To verify account creation, click Confirm Account.