Teamcenter SOA重置密码

alwaysmove / 2024-01-22 / 原文

一、Teamcenter SOA重置密码

import com.teamcenter.services.internal.loose.administration.UserManagementService;

UserManagementService useRestService = UserManagementService.getService(AppXSession.getConnection());
try {
        boolean isSuccess = useRestService.resetUserPassword(userId, oldPassword, newPassword);
        if(!isSuccess){
            throw new RuntimeException(userId +"--->密码修改失败!");
        }
}            

二、注意:

1、用DBA账号登录SOA,改密码的话,是不会校验旧密码的。但是普通用户会校验

2、AWC改密码也是用了 resetUserPassword的API

"change": {
            "actionType": "TcSoaService",
            "serviceName": "Internal-Administration-2015-10-UserManagement",
            "method": "resetUserPassword",
            "inputData": {
                "userid": "{{ctx.userSession.props.user_id.dbValues[0]}}",
                "oldpassword": "{{data.currentPassword.dbValue}}",
                "newpassword": "{{data.newPassword.dbValue}}"
            },