简体   繁体   English

如何在WSO2 Identity Server 5.3.0中从CSV批量导入中配置密码到期时间

[英]How to configure password expire time in bulk import from CSV in WSO2 Identity Server 5.3.0

Hi I am using WSO2 Identity Server 5.3.0. 嗨,我正在使用WSO2 Identity Server 5.3.0。 I want to create users by using bulk import from a CSV File. 我想通过使用从CSV文件批量导入来创建用户。 I am able to do it successfully. 我能够成功做到。

Problem Statement: 问题陈述:

Users are created successfully but in the documentation link, it is mentioned that the default password expiry for the users is 24 hours. 用户创建成功,但是在文档链接中提到用户的默认密码有效期为24小时。 Is there any way possible through configuration that we can turn this setting off. 通过配置有什么办法可以关闭此设置。 OR Increase the time for this password expiry. 或增加此密码到期的时间。

Document Link: 文件连结:

I enabled the Bulk storage from user-mgt.xml file. 我从user-mgt.xml文件启用了大容量存储。

 <Property name="MembershipAttribute">member</Property>
            <Property name="BackLinksEnabled">false</Property>
            <Property name="UsernameJavaRegEx">[a-zA-Z0-9._-|//]{3,30}$</Property>
            <Property name="UsernameJavaScriptRegEx">^[\S]{3,30}$</Property>
            <Property name="UsernameJavaRegExViolationErrorMsg">Username pattern policy violated</Property>
            <Property name="PasswordJavaRegEx">^[\S]{5,30}$</Property>
            <Property name="PasswordJavaScriptRegEx">^[\S]{5,30}$</Property>
            <Property name="PasswordJavaRegExViolationErrorMsg">Password length should be within 5 to 30 characters</Property>
            <Property name="RolenameJavaRegEx">[a-zA-Z0-9._-|//]{3,30}$</Property>
            <Property name="RolenameJavaScriptRegEx">^[\S]{3,30}$</Property>
            <Property name="SCIMEnabled">true</Property>
            <Property name="IsBulkImportSupported">true</Property>
            <Property name="EmptyRolesAllowed">true</Property>
            <Property name="PasswordHashMethod">PLAIN_TEXT</Property>
            <Property name="MultiAttributeSeparator">,</Property>
            <Property name="MaxUserNameListLength">500</Property>
            <Property name="MaxRoleNameListLength">100</Property>
            <Property name="kdcEnabled">false</Property>
            <Property name="defaultRealmName">WSO2.ORG</Property>
            <Property name="UserRolesCacheEnabled">true</Property>
            <Property name="ConnectionPoolingEnabled">false</Property>
            <Property name="LDAPConnectionTimeout">5000</Property>
            <Property name="ReadTimeout"/>
            <Property name="RetryAttempts"/>  

But I cannot find any configuration here to configure this time. 但是我在这里找不到任何可以配置的配置。

Currently, Identity Server does not have an out-of-box configuration option for making the password validity period to increase or to turn the setting off. 当前,Identity Server没有现成的配置选项来使密码有效期增加或关闭设置。 However, we can accomplish your requirement of not invalidating the password by writing a custom component by extending relevant UserStoreManager. 但是,通过扩展相关的UserStoreManager来编写自定义组件,我们可以满足您不使密码无效的要求。 For this purpose you can write a custom userstore manager extending the default JDBCUserStoreManager which will make the password to be valid for an indefinite period. 为此,您可以编写一个自定义用户存储管理器,以扩展默认的JDBCUserStoreManager,从而使密码在无限期内有效。 Please refer [1] for more information regarding this. 有关此的更多信息,请参考[1]。 In this sample extension, you need to only override the method "doAddUser()" by making requestPasswordChange variable to false in order to avoid the invalidation of the password. 在此示例扩展中,您只需通过将requestPasswordChange变量设置为false来覆盖方法“ doAddUser()” ,以避免密码无效。 Sample code is as follows. 示例代码如下。

public void doAddUser(String userName, Object credential, String[] roleList,
        Map<String, String> claims, String profileName, boolean requirePasswordChange)
        throws UserStoreException {
    super.doAddUser(userName, credential, roleList, claims, profileName, false);

}

[1] https://docs.wso2.com/display/IS530/Writing+a+Custom+User+Store+Manager [1] https://docs.wso2.com/display/IS530/Writing+a+Custom+User+Store+Manager

One other hack would be directly removing this password expiry property for all the users from the userstore database directly. 另一种破解方法是直接从userstore数据库中删除所有用户的此密码到期属性。 You can simply set "UM_REQUIRE_CHANGE" value for all the users to make their passwords work even after 24hours. 您可以为所有用户简单地设置“ UM_REQUIRE_CHANGE”值,以使他们的密码即使在24小时后仍然有效。

UPDATE UM_USER SET UM_REQUIRE_CHANGE=FALSE;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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