EAS 中重定向 Context及获得用户密码策略

来源:互联网 发布:考研英语网络间谍 编辑:程序博客网 时间:2024/06/16 12:28
//由于后台事务执行时为administrator的Context导致凭证无权限新增,此处赋值为user的ContextILoginModule loginModule = LoginModuleFactory.getLocalInstance(ctx);String encodePwd = CryptoTean.encrypt(Constants.USER1_Number, Constants.USER1_Password);LoginContext loginContext = new LoginContext(Constants.USER1_Number, encodePwd, ctx.getSolution(), ctx.getAIS(), ctx.getLocale());loginContext.put("dbType", "Oracle");loginContext.put("UserAuthPattern", "BaseDB");try{String sessionId = loginModule.login(loginContext);ctx = SessionManager.getInstance().getSession(sessionId).getContext();}catch (BOSLoginException e){e.printStackTrace();throw new BOSException(e.getMessage());}

原创粉丝点击