使用 scim API 在 WSO2 IS 5.9.0 中创建用户时出现以下错误? [英] Getting following error while creating a user in WSO2 IS 5.9.0 using scim API?

查看:30
本文介绍了使用 scim API 在 WSO2 IS 5.9.0 中创建用户时出现以下错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的用户名在创建具有有效负载的用户时映射到电子邮件

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???

推荐答案

WSO2 Identity Server 中可用的默认配置强制用户名是长度为 3 到 30 个非空字符的字符串.您的用例要求用户名长度大于提供的默认范围.为了支持您的要求,请在 <IS_HOME>/repository/conf 提供的 deployment.toml 文件中为用户存储配置添加以下参数,如下所示.

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}'

您可以提供合适的正则表达式来满足您的要求.请注意,前端组件使用 username_java_script_regex 进行用户名验证.

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.

这篇关于使用 scim API 在 WSO2 IS 5.9.0 中创建用户时出现以下错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆