Wednesday, October 7, 2015

How to enable Email as the user name in WSO2 Products


Let us see how to enable email to be used as the user name in WSO2 Products. This feature by default is disabled which can be enabled with ease. For this example I will be using WSO2 Message Broker.


Step 1 - Download and extract the WSO2 MB product


Step 2 - Change configuration in carbon.xml


Open the carbon.xml which can be found under <WSO2MBHOME>/repository/conf/carbon.xml. Un-comment the below section,

<!--EnableEmailUserName>true</EnableEmailUserName-->


Step 3 -  Change configuration in user-mgt.xml


Replace,
 <Property name="UsernameJavaRegEx">^[^~!#$;%^*+={}\\|\\\\&lt;&gt;,\'\"]{3,30}$</Property>
with - 
 <Property name="UsernameJavaRegEx">[a-zA-Z0-9@._-|//]{3,30}$</Property>

Now lets set up the admin account with a email address,

                 <AdminUser>
                     <UserName>jason@yopmail.com</UserName>
                     <Password>123123</Password>
                </AdminUser>

Step 4 - Login to management console


Start message broker by issuing the command <WSO2MBHOME>/bin/wso2server.sh start  if you are using linux distro or <PRODUCT_HOME>\bin\wso2server.bat if you are on windows and navigate to https://localhost:9443/carbon. Now you can login to console with the above credentials.

No comments:

Post a Comment