Package org.wso2.carbon.authenticator.stub

Examples of org.wso2.carbon.authenticator.stub.AuthenticationAdminStub


    public AuthenticationAdminClient(ConfigurationContext ctx, String serverURL, String cookie,
            HttpSession session, boolean doManageSession) throws AxisFault {
        this.session = session;
        this.doManageSession = doManageSession;
        String serviceEPR =  serverURL + "AuthenticationAdmin";
        stub = new AuthenticationAdminStub(ctx, serviceEPR);
        ServiceClient client = stub._getServiceClient();
        Options options = client.getOptions();
        options.setManageSession(this.doManageSession);
        if (cookie != null && this.doManageSession) {
            options.setProperty(HTTPConstants.COOKIE_STRING, cookie);
View Full Code Here


        }
    }

  public boolean authenticate(ConfigurationContext ctx, String serverURL, String username, String password) throws AxisFault, AuthenticationException {
    String serviceEPR = serverURL + "AuthenticationAdmin";
    AuthenticationAdminStub stub = new AuthenticationAdminStub(ctx, serviceEPR);
    ServiceClient client = stub._getServiceClient();
    Options options = client.getOptions();
    options.setManageSession(true);
    try {
      boolean result = stub.login(username, password, serviceEPR);
      if (result){
        cookie = (String) stub._getServiceClient().getServiceContext().
        getProperty(HTTPConstants.COOKIE_STRING);
      }
      return result;
    } catch (Exception e) {
      String msg = "Error occurred while logging in";
View Full Code Here

                                   String passWord,
                                   String hostName,
                                   String domainName)
            throws RemoteException, SocketException, LoginAuthenticationExceptionException {
        try {
            AuthenticationAdminStub authenticationAdminStub =
                    getLoggedAuthAdminStub(serverUrl, userName , passWord, hostName, domainName);
            ServiceContext serivceContext = authenticationAdminStub._getServiceClient().
                    getLastOperationContext().getServiceContext();
            return (String) serivceContext.getProperty(HTTPConstants.COOKIE_STRING);

        } catch (CSGException ex) {
            throw new AxisFault(ex.getMessage());
View Full Code Here

    public AuthenticationAdminStub getLoggedAuthAdminStub(String serverUrl,
                                    String userName,
                                    String passWord,
                                    String hostName,
                                    String domainName) throws CSGException {
        AuthenticationAdminStub authenticationAdminStub;
        boolean isLoggedIn;
        String stratosUserName = userName + "@" + domainName;
        try {
            if (CSGAgentUtils.isClientAxis2XMLExists()) {
                ConfigurationContext configurationContext =
                        ConfigurationContextFactory.createConfigurationContextFromFileSystem(
                                null, CSGConstant.CLIENT_AXIS2_XML);
                authenticationAdminStub =
                        new AuthenticationAdminStub(configurationContext, serverUrl);
            } else {
                authenticationAdminStub = new AuthenticationAdminStub(serverUrl);
            }
            isLoggedIn = authenticationAdminStub.login(stratosUserName, passWord, hostName);
        } catch (Exception e) {
            throw new CSGException(e);
        }

        if(!isLoggedIn){
View Full Code Here

            String userName, String password, String remoteIp) throws Exception {
        String serviceURL = null;
        ServiceClient client = null;
        Options option = null;
        boolean isAuthenticated = false;
        AuthenticationAdminStub authStub = null;

        serviceURL = backendServerURL + "AuthenticationAdmin";
        authStub = new AuthenticationAdminStub(configCtx, serviceURL);
        client = authStub._getServiceClient();
        option = client.getOptions();
        option.setManageSession(true);
        option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, authCookie);
        isAuthenticated = authStub.login(userName, password, remoteIp);
        authCookie = (String) authStub._getServiceClient().getServiceContext()
                .getProperty(HTTPConstants.COOKIE_STRING);
        return isAuthenticated;
    }
View Full Code Here

        String userName = authConfigBean.getUserName();
        String password = authConfigBean.getPassword();
        boolean loginStatus = false;
        String authenticationServiceURL = "https://" + hostName +
                StatusMonitorAgentConstants.AUTHENTICATION_ADMIN_PATH;
        AuthenticationAdminStub authenticationAdminStub;
        try {
            authenticationAdminStub = new AuthenticationAdminStub(authenticationServiceURL);
            ServiceClient client = authenticationAdminStub._getServiceClient();
            Options options = client.getOptions();
            options.setManageSession(true);

            loginStatus = authenticationAdminStub.login(userName, password, hostName);
            ServiceContext serviceContext = authenticationAdminStub.
                    _getServiceClient().getLastOperationContext().getServiceContext();
            // String sessionCookie = (String) serviceContext.getProperty(HTTPConstants.COOKIE_STRING);
            String msg = "Log in client successfully logged in to the service: " + hostName;
            if (log.isDebugEnabled()){
                log.debug(msg);
View Full Code Here

        String userName = authConfigBean.getUserName();
        String password = authConfigBean.getPassword();
        int serviceID = MySQLConnectionInitializer.getServiceID(StatusMonitorConstants.MANAGER);
        String authenticationServiceURL = StatusMonitorConstants.MANAGER_HTTPS +
                StatusMonitorAgentConstants.AUTHENTICATION_ADMIN_PATH;
        AuthenticationAdminStub authenticationAdminStub;
        try {
            authenticationAdminStub = new AuthenticationAdminStub(authenticationServiceURL);
            ServiceClient client = authenticationAdminStub._getServiceClient();
            Options options = client.getOptions();
            options.setManageSession(true);

            Boolean status;
            status = authenticationAdminStub.login(userName, password,
                    StatusMonitorConstants.MANAGER_HOST);
            ServiceContext serviceContext = authenticationAdminStub.
                    _getServiceClient().getLastOperationContext().getServiceContext();
            // String sessionCookie = (String) serviceContext.getProperty(HTTPConstants.COOKIE_STRING);

            if (status) {
                MySQLConnector.insertStats(serviceID, true);
View Full Code Here

        }

        int serviceID = MySQLConnectionInitializer.getServiceID(StatusMonitorConstants.IDENTITY);
        String authenticationServiceURL = StatusMonitorConstants.IDENTITY_HTTPS +
                StatusMonitorAgentConstants.AUTHENTICATION_ADMIN_PATH;
        AuthenticationAdminStub authenticationAdminStub;
        try {
            authenticationAdminStub = new AuthenticationAdminStub(authenticationServiceURL);
            ServiceClient client = authenticationAdminStub._getServiceClient();
            Options options = client.getOptions();
            options.setManageSession(true);

            Boolean status;
            status = authenticationAdminStub.login(authConfigBean.getUserName(),
                    authConfigBean.getPassword(), StatusMonitorConstants.IDENTITY_HOST);
            ServiceContext serviceContext = authenticationAdminStub.
                    _getServiceClient().getLastOperationContext().getServiceContext();
            // String sessionCookie = (String) serviceContext.getProperty(HTTPConstants.COOKIE_STRING);

            if (status) {
                MySQLConnector.insertStats(serviceID, true);
View Full Code Here

                                     ConfigurationContext configCtx,
                                     Locale locale) throws AxisFault {
        String serviceURL = backendServerURL + "AuthenticationAdmin";
        bundle = ResourceBundle.getBundle(BUNDLE, locale);
        this.backendServerURL = backendServerURL;
        stub = new AuthenticationAdminStub(configCtx, serviceURL);
    }
View Full Code Here

     * @return The end line number, or -1 if could not be determined
     */
    public int getEndLineNumber() {
      int ret=-1;
     
      ActivityInterface parent=getParent();
     
      if (parent != null) {
        int index=parent.getSubActivities().indexOf(this);
       
        if (index != -1) {
          if (index < (parent.getSubActivities().size()-1)) {
            ActivityInterface other=parent.getSubActivities().get(index+1);
           
            ret = other.getStartLineNumber()-1;
          } else {
            ret = parent.getEndLineNumber();
          }
        }
      }
View Full Code Here

TOP

Related Classes of org.wso2.carbon.authenticator.stub.AuthenticationAdminStub

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.