Examples of AuthenticationAdminClient


Examples of org.wso2.carbon.authenticator.proxy.AuthenticationAdminClient

    public boolean reAuthenticateOnSessionExpire(Object object) throws AuthenticationException {
        boolean isValidRememberMe = false;
        try {
            HttpServletRequest request = (HttpServletRequest) object;
            AuthenticationAdminClient client = getAuthenticationAdminCient(request);
            Cookie[] cookies = request.getCookies();
            for (Cookie cookie : cookies) {
                if (cookie.getName().equals(CarbonConstants.REMEMBER_ME_COOKE_NAME)) {
                    isValidRememberMe = client.loginWithRememberMeCookie(cookie.getValue());
                }
            }

        } catch (AxisFault e) {
            log.error(e.getMessage(), e);
View Full Code Here

Examples of org.wso2.carbon.authenticator.proxy.AuthenticationAdminClient

                throw new RemoteException(msg);
            }
            // Obtain the back-end server URL from the request. If not obtain it
            // from the http session and then from the ServletContext.

            AuthenticationAdminClient proxy = getAuthenticationAdminCient(request);

            String userNameWithDomain = userName;
            String domainName = (String) request.getAttribute(MultitenantConstants.TENANT_DOMAIN);
            if (domainName != null) {
                userNameWithDomain += "@" + domainName;
            }
            userNameWithDomain = userNameWithDomain.trim();
            boolean isLogged = false;
            if (isRememberMe) {
                RememberMeData data = proxy.loginWithRememberMeOption(userNameWithDomain, password,
                        request.getRemoteAddr());
                if (data != null) {
                    isLogged = true;
                    request.setAttribute(CarbonConstants.REMEMBER_ME_COOKIE_VALUE, data.getValue());
                    request.setAttribute(CarbonConstants.REMEMBER_ME_COOKIE_AGE,
                            new Integer(data.getMaxAge()).toString());
                }
            } else {
                isLogged = proxy.login(userNameWithDomain, password, request.getRemoteAddr());
            }
            return isLogged;
        } catch (AxisFault axisFault) {
            throw axisFault;
        } catch (RemoteException e) {
View Full Code Here

Examples of org.wso2.carbon.authenticator.proxy.AuthenticationAdminClient

        ConfigurationContext configContext = (ConfigurationContext) servletContext
                .getAttribute(CarbonConstants.CONFIGURATION_CONTEXT);

        String cookie = (String) session.getAttribute(ServerConstants.ADMIN_SERVICE_AUTH_TOKEN);

        return new AuthenticationAdminClient(configContext, backendServerURL, cookie, session, true);

    }
View Full Code Here

Examples of org.wso2.carbon.authenticator.proxy.AuthenticationAdminClient

        }

        public String login() throws UserStoreException {
            try {
                synchronized (stub) {
                    AuthenticationAdminClient client = new AuthenticationAdminClient(
                            UserMgtWSAPIDSComponent.getCcServiceInstance().getClientConfigContext(),
                            url, null, null, false);
                    boolean isLogin = client.login(userName, password, "127.0.0.1");
                    if (isLogin) {
                        return client.getAdminCookie();
                    } else {
                        log.error("Error login in tenant manager");
                        throw new UserStoreException("Error login in tenant manager");
                    }
                }
View Full Code Here

Examples of org.wso2.carbon.authenticator.proxy.AuthenticationAdminClient

        String userName = realmConfig.getRealmProperty(WSRemoteUserMgtConstants.USER_NAME);
        String password = realmConfig.getRealmProperty(WSRemoteUserMgtConstants.PASSWORD);
        try {
            ConfigurationContext configContext = (ConfigurationContext) UserMgtWSAPIDSComponent
                    .getCcServiceInstance().getClientConfigContext();
            AuthenticationAdminClient client = new AuthenticationAdminClient(configContext,
                                                                             realmConfig.getRealmProperty(WSRemoteUserMgtConstants.SERVER_URL),
                                                                             sessionCookie, null, false);
            boolean isLogin = client.login(userName, password, "127.0.0.1"); // TODO
            if (isLogin) {
                sessionCookie = client.getAdminCookie();
            }
        } catch (Exception e) {
            throw new UserStoreException("Error" + e.getMessage(), e);
        }
    }
View Full Code Here

Examples of org.wso2.carbon.authenticator.proxy.AuthenticationAdminClient

    }

    public static String login(String serverUrl, String userName, String password) throws Exception {
        String sessionCookie = null;
        try {
            AuthenticationAdminClient client =
                    new AuthenticationAdminClient(Util.getConfigurationContextService()
                            .getClientConfigContext(), serverUrl, null, null, false);
            // TODO : get the correct IP
            boolean isLogin = client.login(userName, password, "127.0.0.1");
            if (isLogin) {
                sessionCookie = client.getAdminCookie();
            }
        } catch (Exception e) {
            throw new Exception("Error in login to throttling manager. server: " + serverUrl +
                    "username: " + userName + ".", e);
        }
View Full Code Here

Examples of org.wso2.carbon.authenticator.proxy.AuthenticationAdminClient

    public static String login(String serverUrl, String userName, String password) throws
                                                                                   UserStoreException {
        String sessionCookie = null;
        try {
            AuthenticationAdminClient client =
                    new AuthenticationAdminClient(DataHolder.getInstance().getClientConfigContext(),
                                                  serverUrl, null, null, false);
            //TODO : get the correct IP
            boolean isLogin = client.login(userName, password, "127.0.0.1");
            if (isLogin) {
                sessionCookie = client.getAdminCookie();
            }
        } catch (Exception e) {
            throw new UserStoreException("Error in login to the server server: " + serverUrl +
                                         "username: " + userName + ".", e);
        }
View Full Code Here

Examples of org.wso2.carbon.authenticator.proxy.AuthenticationAdminClient

    //case of 2_0_X
    private boolean authenticateWithServer_Carbon_3_0_0(ServerDO server) {
        boolean isLoggedIn = false;

        try {
            AuthenticationAdminClient authenticationAdminClient_3_0_0 =
                    new AuthenticationAdminClient(BAMUtil.getConfigurationContextService().getClientConfigContext(),
                            server.getServerURL() + "/services/", null, null, false);

            isLoggedIn = authenticationAdminClient_3_0_0.login(server.getUserName(), server.getPassword(),
                    NetworkUtils.getLocalHostname());

            if (isLoggedIn) {
                getSessionCache().addSessionString(server.getServerURL(),authenticationAdminClient_3_0_0.getAdminCookie());
            }
        } catch (Throwable ignore) {
            log.debug("Carbon 300 authentication failed with server: " + server.toString(), ignore);
        }
View Full Code Here

Examples of org.wso2.carbon.authenticator.proxy.AuthenticationAdminClient

    }

    public static String login(String serverUrl, String userName, String password) throws Exception {
        String sessionCookie = null;
        try {
            AuthenticationAdminClient client =
                    new AuthenticationAdminClient(ThrottlingAgentServiceComponent.getThrottlingAgent().getConfigurationContextService()
                            .getClientConfigContext(), serverUrl, null, null, false);
            // TODO : get the correct IP
            boolean isLogin = client.login(userName, password, "127.0.0.1");
            if (isLogin) {
                sessionCookie = client.getAdminCookie();
            }
        } catch (Exception e) {
            throw new Exception("Error in login to throttling manager. server: " + serverUrl +
                    "username: " + userName + ".", e);
        }
View Full Code Here

Examples of org.wso2.carbon.authenticator.proxy.AuthenticationAdminClient

   
    private String login(String serverUrl, String userName,
                               String password, ConfigurationContext confContext) throws UserStoreException {
        String sessionCookie = null;
        try {
            AuthenticationAdminClient client =
                    new AuthenticationAdminClient(confContext, serverUrl, null, null, false);
            //TODO : get the correct IP
            boolean isLogin = client.login(userName, password, "127.0.0.1");
            if (isLogin) {
                sessionCookie = client.getAdminCookie();
            }
        } catch (Exception e) {
            throw new UserStoreException("Error in login to the server server: " + serverUrl +
                                         "username: " + userName + ".", e);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.