Showing posts with label create user using username or email. Show all posts
Showing posts with label create user using username or email. Show all posts

Sunday, January 8, 2017

Create user using user_name or email in WSO2 Idenity Server

Prerequisites:-
WSO2 Identity Server 5.0.0 or above

WSO2 Identity Server you can authenticate using user_name or email. By default authenticate using user_name.

For that , you need to uncomment the EnableEmailUserName in carbon.xml file  [IS_HOME]/repository/conf/ directory as below.
    <!-- Enable following config to allow Emails as usernames. -->
    <EnableEmailUserName>true</EnableEmailUserName>
After you need to do the below changes as well,
  1. Add new property in to the [IS_HOME]/repository/conf/user-mgt.xml file as below,
    <Property name="UsernameWithEmailJavaScriptRegEx">[a-zA-Z0-9@._-|//]{3,30}$</Property>
  2. Do the below changes in user-mgt.xml file as well,<Property name="UsernameJavaRegEx">[a-zA-Z0-9@._-|//]{3,30}$</Property>
    <Property name="UsernameJavaScriptRegEx">[a-zA-Z0-9._-|//]{3,30}$</Property>
After that you can create user using UserName or Email and login as well.
In additionally tenant creation use case, you need to create tenant admin with only email user_name. After that you can create users as your desire.