简体   繁体   中英

WSO2 IS: How to use email AND username as login

I have a WSO2 IS server running with a ReadOnly LDAP user store. Some of the users in that store have an email as username, by default these users cannot login in applications using the IS's oauth2 endpoint. If I follow the instructions here [1] I can make them login without problems, but the rest of users, those without email as username, are no longer allowed to login.

So, my question, is it possible to allow users with AND without email as username to log in an app connected to WSO2 IS through oauth2?

Thanks a lot, cheers

[1] https://docs.wso2.org/display/IS460/Email+Authentication

Try using <Property name="UsernameJavaRegEx">[a-zA-Z0-9._-|//]{3,30}$</Property> instead of one given in the doc.

In the doc, its restricting usernames other than emails. Changing the property as above will remove that restriction.

And add following property under tag in /repository/conf/user-mgt.xml file.

<Property name="UsernameWithEmailJavaScriptRegEx">[a-zA-Z0-9._-|//]{3,30}$</Property>

This will allows you to escape expecting email as a username from UI.

HTH,

DarRay

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM