public WSUserStoreManager(String serverUrl, String cookie, ConfigurationContext configCtxt) throws UserStoreException { try { stub = new RemoteUserStoreManagerServiceStub(configCtxt, serverUrl + SERVICE_NAME); ServiceClient client = stub._getServiceClient(); Options option = client.getOptions(); option.setManageSession(true); option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, cookie); } catch (AxisFault e) { handleException(e.getMessage(), e); } }
public WSUserStoreManager(String serverUrl, String cookie, ConfigurationContext configCtxt) throws UserStoreException { try { stub = new RemoteUserStoreManagerServiceStub(configCtxt, serverUrl + "RemoteUserStoreManagerService"); ServiceClient client = stub._getServiceClient(); Options option = client.getOptions(); option.setManageSession(true); option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, cookie); } catch (AxisFault e) { handleException(e.getMessage(), e); } }
public WSUserStoreManager(String userName, String password, String serverUrl, ConfigurationContext configCtxt) throws UserStoreException { try { if (serverUrl != null && !serverUrl.endsWith("/")) { serverUrl += "/"; } stub = new RemoteUserStoreManagerServiceStub(configCtxt, serverUrl + SERVICE_NAME); HttpTransportProperties.Authenticator authenticator = new HttpTransportProperties.Authenticator(); authenticator.setUsername(userName); authenticator.setPassword(password); authenticator.setPreemptiveAuthentication(true); ServiceClient client = stub._getServiceClient(); Options option = client.getOptions(); option.setManageSession(true); option.setProperty(org.apache.axis2.transport.http.HTTPConstants.AUTHENTICATE, authenticator); } catch (AxisFault e) { handleException(e.getMessage(), e); } }
public RemoteAuthorizationManagerClient() throws AppManagementException { AppManagerConfiguration config = ServiceReferenceHolder.getInstance(). getAPIManagerConfigurationService().getAPIManagerConfiguration(); String serviceURL = config.getFirstProperty(AppMConstants.AUTH_MANAGER_URL); username = config.getFirstProperty(AppMConstants.AUTH_MANAGER_USERNAME); password = config.getFirstProperty(AppMConstants.AUTH_MANAGER_PASSWORD); if (serviceURL == null || username == null || password == null) { throw new AppManagementException("Required connection details for authentication " + "manager not provided"); } try { authorizationManager = new RemoteAuthorizationManagerServiceStub(null, serviceURL + "RemoteAuthorizationManagerService"); userStoreManager = new RemoteUserStoreManagerServiceStub(null, serviceURL + "RemoteUserStoreManagerService"); for (ServiceClient client : new ServiceClient[] { authorizationManager._getServiceClient(), userStoreManager._getServiceClient()}) { Options options = client.getOptions(); options.setTimeOutInMilliSeconds(TIMEOUT_IN_MILLIS); options.setProperty(HTTPConstants.SO_TIMEOUT, TIMEOUT_IN_MILLIS); options.setProperty(HTTPConstants.CONNECTION_TIMEOUT, TIMEOUT_IN_MILLIS); options.setCallTransportCleanup(true); options.setManageSession(true); } } catch (AxisFault axisFault) { throw new AppManagementException("Error while initializing the user management stubs", axisFault); } }
userStoreManagerStub = new RemoteUserStoreManagerServiceStub(configContext, serviceURL + "RemoteUserStoreManagerService"); ServiceClient svcClient = userStoreManagerStub._getServiceClient();