Examples of LoginException


Examples of com.almilli.movierentals.LoginException

                String result = login.getResponseBodyAsString();
                login.releaseConnection();

                if (result.indexOf("Site Unavailable") != -1) {
                    String pattern = RESOURCES.getString("login.siteUnavailable");
                    throw new LoginException(MessageFormat.format(pattern, getName()));
                }
               
                if (result.indexOf("password combination is invalid") != -1) {
                    throw new LoginException(RESOURCES.getString("login.invalidUserPass"));
                }
                if (result.indexOf("We could not find your login information") != -1) {
                    throw new LoginException(RESOURCES.getString("login.invalidUserPass"));
                }
                if (result.indexOf("Sign In") != -1) {
                    throw new LoginException(RESOURCES.getString("login.invalidUserPass"));
                }
               
                if (code >= 400 && result.indexOf("Movies in Queue") == -1) {
                    String pattern = RESOURCES.getString("login.internalError");
                    throw new LoginException(MessageFormat.format(pattern, getName()));
                }
       
      } catch (IOException e) {
                LoginException io = new LoginException("A server error occurred when logging in user.");
        io.initCause(e);
        throw io;
      }
           
            //now force the queue to be synced up so that we will know what is in the queue
            //and what isn't
View Full Code Here

Examples of com.finiac.exception.LoginException

  }
 
  public boolean userLogin(HttpServletRequest request, String userName, String password)throws Exception
  {
    if(userName==null || password == null)
      throw new LoginException();
    String cryptPassword = DigestUtils.sha256Hex(password +passwordHashPadding);
    User user = new User();
    List<User> userList=userDAO.selectUser(userName,cryptPassword);
    if(userList.size()==0)
      throw new LoginException();
    for(int i=0;i<userList.size();i++)
    {
      user = userList.get(i);
    }
    request.getSession().setAttribute("userName", user.getUserName());
View Full Code Here

Examples of com.sun.enterprise.security.LoginException

     * @throws LoginException If login fails (JAAS login() behavior).
     */   
    protected void authenticate() throws LoginException {
        if (!(_currentRealm instanceof JDBCRealm)) {
            String msg = sm.getString("jdbclm.badrealm");
            throw new LoginException(msg);
        }
       
        final JDBCRealm jdbcRealm = (JDBCRealm)_currentRealm;

        // A JDBC user must have a name not null and non-empty.
        if ( (_username == null) || (_username.length() == 0) ) {
            String msg = sm.getString("jdbclm.nulluser");
            throw new LoginException(msg);
        }
       
        String[] grpList = jdbcRealm.authenticate(_username, _password);

        if (grpList == null) {  // JAAS behavior
            String msg = sm.getString("jdbclm.loginfail", _username);
            throw new LoginException(msg);
        }

        if (_logger.isLoggable(Level.FINEST)) {
            _logger.finest("JDBC login succeeded for: " + _username
                + " groups:" + grpList);
View Full Code Here

Examples of com.sun.enterprise.security.auth.login.common.LoginException

     * @throws LoginException If login fails (JAAS login() behavior).
     */   
    protected void authenticate() throws LoginException {
        if (!(_currentRealm instanceof JDBCRealm)) {
            String msg = sm.getString("jdbclm.badrealm");
            throw new LoginException(msg);
        }
       
        final JDBCRealm jdbcRealm = (JDBCRealm)_currentRealm;

        // A JDBC user must have a name not null and non-empty.
        if ( (_username == null) || (_username.length() == 0) ) {
            String msg = sm.getString("jdbclm.nulluser");
            throw new LoginException(msg);
        }
       
        String[] grpList = jdbcRealm.authenticate(_username, getPasswordChar());

        if (grpList == null) {  // JAAS behavior
            String msg = sm.getString("jdbclm.loginfail", _username);
            throw new LoginException(msg);
        }

        if (_logger.isLoggable(Level.FINEST)) {
            _logger.finest("JDBC login succeeded for: " + _username
                + " groups:" + Arrays.toString(grpList));
View Full Code Here

Examples of it.unipd.netmus.shared.exception.LoginException

    public String getLoggedInUser() throws LoginException {

        HttpSession session = getThreadLocalRequest().getSession();
        String user = LoginHelper.getLoggedInUser(session);
        if (user == null) {
            throw new LoginException();
        }
        return user;

    }
View Full Code Here

Examples of javax.jcr.LoginException

            method = new PropFindMethod(uriResolver.getWorkspaceUri(workspaceName), nameSet, DEPTH_0);
            getClient(sessionInfo).executeMethod(method);

            MultiStatusResponse[] responses = method.getResponseBodyAsMultiStatus().getResponses();
            if (responses.length != 1) {
                throw new LoginException("Login failed: Unknown workspace '" + workspaceName+ "'.");
            }

            DavPropertySet props = responses[0].getProperties(DavServletResponse.SC_OK);
            DavProperty<?> prop = props.get(JcrRemotingConstants.JCR_WORKSPACE_NAME_LN, ItemResourceConstants.NAMESPACE);
            if (prop != null) {
                String wspName = prop.getValue().toString();
                if (workspaceName == null) {
                    // login with 'null' workspace name -> retrieve the effective
                    // workspace name from the property and recreate the SessionInfo.
                    sessionInfo = new SessionInfoImpl(credentials, wspName);
                } else if (!wspName.equals(workspaceName)) {
                    throw new LoginException("Login failed: Invalid workspace name '" + workspaceName + "'.");
                }
            } else if (props.contains(DeltaVConstants.WORKSPACE)) {
                String wspHref = new HrefProperty(props.get(DeltaVConstants.WORKSPACE)).getHrefs().get(0);
                String wspName = Text.unescape(Text.getName(wspHref, true));
                if (!wspName.equals(workspaceName)) {
                    throw new LoginException("Login failed: Invalid workspace name " + workspaceName);
                }
            } else {
                throw new LoginException("Login failed: Unknown workspace '" + workspaceName+ "'.");
            }
        } catch (IOException e) {
            throw new RepositoryException(e.getMessage());
        } catch (DavException e) {
            throw ExceptionConverter.generate(e);
View Full Code Here

Examples of javax.jcr.LoginException

    public Session getSession(HttpServletRequest request, Repository rep,
            String workspace) throws LoginException {

        // we do not accept the anonymous session for WebDAV !
        if (request.getAuthType() == null) {
            throw new LoginException("Authentication required for WebDAV");
        }

        // otherwise return the session from the request attribute
        ResourceResolver resourceResolver = (ResourceResolver)
            request.getAttribute(AuthenticationSupport.REQUEST_ATTRIBUTE_RESOLVER);
View Full Code Here

Examples of javax.jcr.LoginException

            RepositoryException {
        final ServiceUserMapper serviceUserMapper = this.getSlingRepositoryManager().getServiceUserMapper();
        final String userName = (serviceUserMapper != null) ? serviceUserMapper.getServiceUserID(this.usingBundle,
            subServiceName) : null;
        if (userName == null) {
            throw new LoginException("Cannot derive user name for bundle " + usingBundle + " and sub service "
                + subServiceName);
        }
        return getNamespaceAwareSession(createServiceSession(userName, workspace));
    }
View Full Code Here

Examples of javax.jcr.LoginException

     * @throws RepositoryException If the login fails or has been disabled
     */
    public final Session loginAdministrative(String workspace) throws RepositoryException {
        if (this.getSlingRepositoryManager().isDisableLoginAdministrative()) {
            log.error("SlingRepository.loginAdministrative is disabled. Please use SlingRepository.loginService.");
            throw new LoginException();
        }

        log.debug("SlingRepository.loginAdministrative is deprecated. Please use SlingRepository.loginService.");
        return getNamespaceAwareSession(createAdministrativeSession(workspace));
    }
View Full Code Here

Examples of javax.jcr.LoginException

    }

    public final Session loginAdministrative(String workspace) throws RepositoryException {
        if (this.disableLoginAdministrative) {
            log(LogService.LOG_ERROR, "SlingRepository.loginAdministrative is disabled. Please use SlingRepository.loginService.");
            throw new LoginException();
        }

        log(LogService.LOG_WARNING,
            "SlingRepository.loginAdministrative is deprecated. Please use SlingRepository.loginService.");
        return loginAdministrativeInternal(workspace);
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.