Examples of LoginResult


Examples of com.google.gerrit.common.auth.userpass.LoginResult

  }

  @Override
  public void authenticate(String username, final String password,
      final AsyncCallback<LoginResult> callback) {
    LoginResult result = new LoginResult(authType);
    if (username == null || "".equals(username.trim()) //
        || password == null || "".equals(password)) {
      result.setError(LoginResult.Error.INVALID_LOGIN);
      callback.onSuccess(result);
      return;
    }

    username = username.trim();

    final AuthRequest req = AuthRequest.forUser(username);
    req.setPassword(password);

    final AuthResult res;
    try {
      res = accountManager.authenticate(req);
    } catch (AccountUserNameException e) {
      // entered user name and password were correct, but user name could not be
      // set for the newly created account and this is why the login fails,
      // error screen with error message should be shown to the user
      callback.onFailure(e);
      return;
    } catch (AuthenticationUnavailableException e) {
      result.setError(LoginResult.Error.AUTHENTICATION_UNAVAILABLE);
      callback.onSuccess(result);
      return;
    } catch (AccountException e) {
      log.info(String.format("'%s' failed to sign in: %s", username, e.getMessage()));
      result.setError(LoginResult.Error.INVALID_LOGIN);
      callback.onSuccess(result);
      return;
    }

    result.success = true;
View Full Code Here

Examples of com.gwtplatform.carstore.shared.dispatch.LogInResult

        logger.info("LogInHandlerexecut(): actiontype=" + getActionType());
        logger.info("LogInHandlerexecut(): currentUserDto=" + currentUserDto);
        logger.info("LogInHandlerexecut(): loggedInCookie=" + loggedInCookie);

        return new LogInResult(action.getActionType(), currentUserDto, loggedInCookie);
    }
View Full Code Here

Examples of com.sforce.soap.enterprise.LoginResult

                return messageContext;
            }
        };

        final SoapBindingStub soapBindingStub = mock(SoapBindingStub.class);
        final LoginResult loginResult = new LoginResult();
        loginResult.setSessionId("something unique");
        when(soapBindingStub.login(anyString(), anyString())).thenReturn(loginResult);

        final SforceServiceLocator sforceServiceLocator = spy(new SforceServiceLocator());
        when(sforceServiceLocator.getSoap()).thenReturn(soapBindingStub);
View Full Code Here

Examples of com.sforce.soap.partner.LoginResult

    return sfSoap;
  }
 
  private void login(String username, String password, URL url) throws ResourceException {
    if (!isValid()) {
      LoginResult loginResult = null;
      sfSoap = null;
      sfService = null;
      co = new CallOptions();
      // This value identifies Teiid as a SF certified solution.
      // It was provided by SF and should not be changed.
      co.setClient("RedHat/MetaMatrix/"); //$NON-NLS-1$
     
      if(url == null) {
        throw new ResourceException("SalesForce URL is not specified, please provide a valid URL"); //$NON-NLS-1$
      }

      Bus bus = BusFactory.getThreadDefaultBus();
      BusFactory.setThreadDefaultBus(mcf.getBus());
      try {
        sfService = new SforceService();
        sfSoap = sfService.getSoap();
        ((BindingProvider)sfSoap).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, url.toExternalForm());
        loginResult = sfSoap.login(username, password);
      } catch (LoginFault e) {
        throw new ResourceException(e);
      } catch (InvalidIdFault e) {
        throw new ResourceException(e);
      } catch (com.sforce.soap.partner.UnexpectedErrorFault e) {
        throw new ResourceException(e);
      } finally {
        BusFactory.setThreadDefaultBus(bus);
      }
      LogManager.logTrace(LogConstants.CTX_CONNECTOR, "Login was successful for username " + username); //$NON-NLS-1$

      sh = new SessionHeader();
      sh.setSessionId(loginResult.getSessionId());
      // Reset the SOAP endpoint to the returned server URL
      ((BindingProvider)sfSoap).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,loginResult.getServerUrl());
      // or maybe org.apache.cxf.message.Message.ENDPOINT_ADDRESS
      ((BindingProvider)sfSoap).getRequestContext().put(BindingProvider.SESSION_MAINTAIN_PROPERTY,Boolean.TRUE);
      // Set the timeout.
      //((BindingProvider)sfSoap).getRequestContext().put(JAXWSProperties.CONNECT_TIMEOUT, timeout);
View Full Code Here

Examples of com.sforce.soap.partner.LoginResult

            newBinding.setCallOptions(API_CLIENT_NAME, null);

            logger.info("Logging in as " + bindingConfig.getUsername() + "/" + bindingConfig.getPassword() + " to URL: " + bindingConfig.getAuthEndpoint());
            if (bindingConfig.isManualLogin()) {
                LoginResult loginResult = newBinding.login(bindingConfig.getUsername(), bindingConfig.getPassword());
                // if password has expired, throw an exception
                if (loginResult.getPasswordExpired()) {
                    throw new PasswordExpiredException(Messages.getString("Client.errorExpiredPassword")); //$NON-NLS-1$
                }
                // update session id and service endpoint based on response
                newBinding.setSessionHeader(loginResult.getSessionId());
                bindingConfig.setServiceEndpoint(loginResult.getServerUrl());
            }
            return newBinding;
        } catch (ConnectionException e) {
            // in case of exception try to get a connection again
            if (retries < 3) {
View Full Code Here

Examples of com.sforce.soap.partner.wsc.LoginResult

                logger.debug("Successfully created new partner connection");
                logger.debug("Logging in...");
            }

            if (Utils.isEmpty(connectorConfig.getSessionId())) {
                LoginResult loginResult =
                        getPartnerConnection().login(connectorConfig.getUsername(), connectorConfig.getPassword());

                if (loginResult == null) {
                    logger.warn("Login result is null");
                    return;
                }

                logLoginResult(loginResult);

                // record session and org
                getPartnerConnection().setSessionHeader(loginResult.getSessionId());
                setOrgId(loginResult);

                if (!forceProject.isKeepEndpoint()) {
                    getPartnerConnection().getConfig().setServiceEndpoint(loginResult.getServerUrl());
                    connectorConfig.setAuthEndpoint(getPartnerConnection().getConfig().getAuthEndpoint());
                    connectorConfig.setServiceEndpoint(getPartnerConnection().getConfig().getServiceEndpoint());
                    // For some reason, the metadata server gets special treatment in the Partner WSDL and we can obtain it directly
                    setMetadataServerUrl(loginResult.getMetadataServerUrl());
                    setToolingServerUrl(getToolingServiceEndpoint(getPartnerConnection().getConfig().getServiceEndpoint()));
                } else {
                    String metadataServerUrl =
                            changeServer(loginResult.getMetadataServerUrl(), forceProject.getEndpointServer());
                    setMetadataServerUrl(metadataServerUrl);
                    String serverUrl = changeServer(loginResult.getServerUrl(), forceProject.getEndpointServer());
                    setToolingServerUrl(getToolingServiceEndpoint(serverUrl));
                }
            } else {
                // With a sessionId, use the getUserInfo to obtain the relevant information, then construct the other endpoints
                GetUserInfoResult userInfoResult = getPartnerConnection().getUserInfo();
View Full Code Here

Examples of com.ursu.shared.actions.LoginResult

     
      session.setAttribute("login.authenticated", action.getUsername());
      log.severe("\n Username : " + action.getUsername() +" with password: " + action.getPassword()+ " was authenticated!!\n");
      }
   
      return new LoginResult(result);
     
  }
View Full Code Here

Examples of es.urjc.escet.semium.LoginResult

                outStr = "Logout successful!";
                if(redirect!=null)
                    response.sendRedirect(redirect);
            } else if(passwd!=null){
                /** Password supplied, proceed with login **/
                LoginResult lr = sm.logIn("",passwd);
                success = lr.isSuccess();
                outStr = lr.getMessage();
                if(success && redirect!=null)
                    response.sendRedirect(redirect);
            }
        }
       
View Full Code Here

Examples of maqetta.server.orion.authentication.ldap.LdapAuthenticationService.LoginResult

    String pathInfo = req.getPathInfo() == null ? "" : req.getPathInfo(); //$NON-NLS-1$

    if (pathInfo.startsWith("/form")) { //$NON-NLS-1$
      try {
        LoginResult authResult = LdapAuthenticationService.performAuthentication(req, resp);
        if (authResult == LoginResult.OK) {
          // redirection from
          // FormAuthenticationService.setNotAuthenticated
          String versionString = req.getHeader("Orion-Version"); //$NON-NLS-1$
          Version version = versionString == null ? null : new Version(versionString);
View Full Code Here

Examples of mireka.login.LoginResult

    public void execute(CommandParser commandParser) throws IOException,
            Pop3Exception {
        if (session.getSessionState() != AUTHORIZATION_PASS_COMMAND_EXPECTED)
            throw new IllegalSessionStateException();
        String password = commandParser.parseSingleExtendedArgument();
        LoginResult result =
                loginSpecification.evaluatePlain(userCommand.user, password);
        if (result.decision == LoginDecision.VALID) {
            startTransaction(result.principal);
        } else {
            logger.debug("Unsuccessful login result: {}", result.decision);
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.