Getting following error while creating a user in WSO2 IS 5.9.0 using scim API?

女生的网名这么多〃 提交于 2020-08-11 05:01:31

问题


My username is mapped to email while creating a user with payload

{
    "schemas": [
        "urn:ietf:params:scim:schemas:core:2.0:User"
    ],
    "name": {
        "formatted": "Careerex Admin"
    },
    "userName": "careerex.admin@in.aanasonic.com",
    "password": "abc!12345",
    "profileUrl": "www.gmail.com",

    "phoneNumbers": [
        {
            "type": "mobile",
            "value": "9876543210"
        }
    ],
    "locale": "Delhi"
}

I am getting following error regarding restrictions of username-

{
    "schemas": [
        "urn:ietf:params:scim:api:messages:2.0:Error"
    ],
    "scimType": "invalidValue",
    "detail": "31301 - Username careerex.admin@in.aanasonic.com is not valid. User name must be a non null string with following format, ^[\\S]{3,30}$",
    "status": "400"
}

Please help how to fix this and create user with same email???


回答1:


The default configuration available in WSO2 Identity Server enforces the username to be a string with a length of 3 to 30 non-empty characters. Your usecase requires the username length to be more than the default range provided. To support your requirement, add the following parameters for userstore configuration in the deployment.toml file available at <IS_HOME>/repository/conf as given below.

[user_store]
username_java_script_regex = '^[a-zA-Z0-9.-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$'
username_java_regex='^[a-zA-Z0-9.-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}'

You can provide a suitable regular expression to match your requirement. Note that username_java_script_regex is used by front-end components for username validation.

Refer here for more information.




回答2:


By default, the username in the WSO2 is not allowed as email. You need to configure the product to support username as email. You can follow this documentation to achieve this



来源:https://stackoverflow.com/questions/59487745/getting-following-error-while-creating-a-user-in-wso2-is-5-9-0-using-scim-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!