Search in sources :

Example 1 with LoggedUserInfoAdminStub

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();
}
Also used : Options(org.apache.axis2.client.Options) ServiceClient(org.apache.axis2.client.ServiceClient) LoggedUserInfoAdminStub(org.wso2.carbon.core.commons.stub.loggeduserinfo.LoggedUserInfoAdminStub)

Aggregations

Options (org.apache.axis2.client.Options)1 ServiceClient (org.apache.axis2.client.ServiceClient)1 LoggedUserInfoAdminStub (org.wso2.carbon.core.commons.stub.loggeduserinfo.LoggedUserInfoAdminStub)1