WSO2 Identity Server allows the user to recover their account username or password via a user-preferred channel. After initiating a username or password recovery, the user will be prompted to select a recovery channel and the user will then be notified via the selected notification channel.
Channel Name | Claim | Channel Verified Claim |
---|---|---|
SMS | http://wso2.org/claims/mobile | http://wso2.org/claims/phoneVerified |
http://wso2.org/claims/emailaddress | http://wso2.org/claims/emailVerified |
This page guides you through configuring a user-preferred channel for account recovery and trying it out.
Table of Contents
Account recovery flow
- The user provides a set of unique claims to identify the user account.
- Then, the server will prompt the user to select one of the available notification channels to receive the recovery notification.
- The user selects a notification channel.
- The server sends the recovery notification to the user via the preferred notification channel.
- If the flow is initiated for password recovery and the preferred channel is:
- Email: Click on the reset link in the email and reset the password.
- SMS: Provide the received One-Time Password(OTP) and reset the password.
...
- Click Resident under Identity Providers.
- Expand Account Management Policies and then expand Account Recovery.
- Select Enable Notification Based Password Recovery and Enable Username Recovery.
- Set the SMS OTP Expiry Time to configure the validation time of the OTP codes.
- Select Internal Notification Management to enable sending notifications from WSO2 Identity Server. WSO2 IS is capable of sending notifications via Email or SMS.
- Add the following SMS templates to the registry. For instructions, see Managing SMS Notification Templates Using the Registry.
- passwordReset
- passwordResetSucess
- resendPasswordReset
- accountIdRecovery
Panel borderColor Black bgColor White Expand title Template Properties Username recovery template
- Folder name: accountidrecovery
- Resource name: en_us
- Body = ["Hello, your username is {{userstore-domain}}/{{user-name}}@{{tenant-domain}}"]
- display : accountIdRecovery
- type : accountIdRecovery
- locale : en_US
Password reset notification template
- Folder name : passwordreset
- Resource name: en_us
- Body = ["Your One-Time Password is : {{confirmation-code}}"]
- display : passwordReset
- type : passwordReset
- locale : en_US
Password reset successful template
- Folder name: passwordresetsucess
- Resource name: en_us
- Body = ["Successful Password Reset"]
- display : passwordResetSucess
- type : passwordResetSucess
- locale : en_US
Resend password reset code template
- Folder name: resendpasswordreset
- Resource name: en_us
- Body = ["Your One-Time Password is : {{confirmation-code}}"]
- display : resendPasswordReset
- type : resendPasswordReset
- locale : en_US
Click Claims > Add > Add Local Claim.
Add the
Preferred Channel Claim
as a local claim: http://wso2.org/claims/identity/preferredChannel.Note The claim URI is case sensitive.
NOTE: Not configuring the above claim will give errors.
...