use of org.wso2.carbon.core.commons.stub.loggeduserinfo.LoggedUserInfoAdminStub in project carbon-apimgt by wso2.
the class APIUtil method getLoggedInUserInfo.
/**
* Gets the information of the logged in User.
*
* @param cookie Cookie of the previously logged in session.
* @param serviceUrl Url of the authentication service.
* @return LoggedUserInfo object containing details of the logged in user.
* @throws ExceptionException
* @throws RemoteException
*/
public static LoggedUserInfo getLoggedInUserInfo(String cookie, String serviceUrl) throws RemoteException, ExceptionException {
LoggedUserInfoAdminStub stub = new LoggedUserInfoAdminStub(null, serviceUrl + "LoggedUserInfoAdmin");
ServiceClient client = stub._getServiceClient();
Options options = client.getOptions();
options.setManageSession(true);
options.setProperty(HTTPConstants.COOKIE_STRING, cookie);
return stub.getUserInfo();
}
Aggregations