@Override
    public LoginDashboardUserVO login(final String userName, final String password, final String clientId) {
        DashboardUserVO dashboardUserVO = null;
        final String cbcDecryptPassword;
        if (StringUtils.isNotBlank(secretProperties.getKey()) && StringUtils.isNotBlank(secretProperties.getIv())) {
            cbcDecryptPassword = AesUtils.cbcDecrypt(secretProperties.getKey(), secretProperties.getIv(), password);
        } else {
            cbcDecryptPassword = password;
        }

        if (Objects.nonNull(ldapTemplate)) {
            dashboardUserVO = loginByLdap(userName, cbcDecryptPassword);
        }

        if (Objects.isNull(dashboardUserVO)) {
            dashboardUserVO = loginByDatabase(userName, cbcDecryptPassword);
        }

        final LoginDashboardUserVO loginDashboardUserVO = LoginDashboardUserVO.buildLoginDashboardUserVO(dashboardUserVO);
        final DashboardUserVO finalDashboardUserVO = dashboardUserVO;
        return Optional.ofNullable(loginDashboardUserVO)
                .map(loginUser -> {
                    if (Boolean.FALSE.equals(loginUser.getEnabled())) {
                        return loginUser;
                    }
                    if (Objects.nonNull(clientId)) {
                        DashboardUserDO userDO = new DashboardUserDO();
                        userDO.setId(loginUser.getId());
                        userDO.setClientId(clientId);
                        dashboardUserMapper.updateSelective(userDO);
                    }
                    return loginUser.setToken(JwtUtils.generateToken(finalDashboardUserVO.getUserName(), finalDashboardUserVO.getPassword(),
                            clientId, jwtProperties.getExpiredSeconds())).setExpiredTime(jwtProperties.getExpiredSeconds());
                })
                .orElse(null);
    }
To deal with the admin login.

@param userName default username is admin
@param password admin password
@param clientId client id
@return {@linkplain LoginDashboardUserVO}
shenyu-admin/src/main/java/org/apache/shenyu/admin/service/impl/DashboardUserServiceImpl.java