简体   繁体   中英

OpenText LiveLink : How can use ImpersonateUser function?

I'd like to have from an admin user the context of the current loggin user. For that, I use the admin token to have the current one with the function impersonateUser() because I don't have the password of the user.

I have the following error when I call the impersonateUser() on the Authentication object : javax.xml.ws.soap.SOAPFaultException: OTDS username and password are required.

Here my example :

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);

I also found a class ImpersonateUser but I don't know how to use it :

ImpersonateUser impUser = new ImpersonateUser();
impUser.setUserName(newUser);

Do you have any advice ?

Thanks !

这是ImpersonateUser()方法的文档

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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