This is quite the same question as WSO2 identity server email as username but we want to have both choice to provide username as email address or user's name (pseudo without @).
I understand the problem with the tenant fully qualified name using @ but can't we change the @ character for the tenant fully qualified ?
Is it possible to use both email address or user's name as username and if so can you provide the configuration, I cannot make it work following https://docs.wso2.com/display/IS520/Using+Email+Address+as+the+Username
I edited my question to test both Rajjaz Mohammed and Pradeepa Wickramasinghe answers :
I commented <Property name="UsernameJavascriptRegEx">
When I add a user without @ I get :
Caused by: org.wso2.carbon.user.core.UserStoreException: Username jacques.martin is not valid. User name must be a non null string with following format, ^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$
at org.wso2.carbon.user.core.common.AbstractUserStoreManager.addUser(AbstractUserStoreManager.java:1405)
If I remove this tag <Property name="UsernameJavaRegEx">
I get the following error :
TID: [1] [] [2016-11-22 13:16:50,409] admin@test.com@mytenant.com [1] [IS]ERROR {org.wso2.carbon.identity.mgt.util.Utils} - Unable to retrieve the claim for user : jacques.martin@mytenant.com
org.wso2.carbon.user.core.UserStoreException: UserNotFound: User jacques.martin@mytenant.comdoes not exist in: PRIMARY
at org.wso2.carbon.user.core.common.AbstractUserStoreManager.callSecure(AbstractUserStoreManager.java:168)
at org.wso2.carbon.user.core.common.AbstractUserStoreManager.getUserClaimValues(AbstractUserStoreManager.java:697)
at org.wso2.carbon.identity.mgt.util.Utils.getClaimFromUserStoreManager(Utils.java:189)
at org.wso2.carbon.identity.mgt.util.Utils.getEmailAddressForUser(Utils.java:226)
at org.wso2.carbon.identity.mgt.mail.AbstractEmailSendingModule.getNotificationAddress(AbstractEmailSendingModule.java:53)
at org.wso2.carbon.identity.mgt.RecoveryProcessor.notifyWithEmail(RecoveryProcessor.java:541)
at org.wso2.carbon.identity.mgt.services.UserInformationRecoveryService.registerUser(UserInformationRecoveryService.java:890)
Same error with Pradeepa Wickramasinghe's answer.
My java code is as follow :
userInformationRecoveryClient.registerUser(user.getUsername(), user.getPassword(), claims, "default", tenant );
In claims I have correctly set http://wwso2.org/claims/email