我想有一个管理员用户的当前登录用户的上下文。为此,我使用管理令牌通过函数impersonateUser()获得当前令牌,因为我没有用户的密码。
在身份验证对象上调用impersonateUser()时出现以下错误: javax.xml.ws.soap.SOAPFaultException:需要OTDS用户名和密码。
下面是我的例子:
URL authLocation = new URL("http://localhost:8080/les-services/services/Authentication?wsdl");
String aToken = WebServiceUtil.getAuthenticationToken(authLocation, username, password);//admin token
OTAuthentication fOTAuth = new OTAuthentication();
fOTAuth.setAuthenticationToken(aToken);
com.opentext.livelink.service.core.Authentication auth = webServiceUtil.getAuthenticationService(authLocation);
String token = auth.impersonateUser(newUser);
fOTAuth.setAuthenticationToken(token);我还发现了一个ImpersonateUser类,但我不知道如何使用它:
ImpersonateUser impUser = new ImpersonateUser();
impUser.setUserName(newUser);你有什么建议吗?
谢谢!
发布于 2017-02-03 23:26:31
下面是ImpersonateUser()方法的docs。
https://stackoverflow.com/questions/42008395
复制相似问题