Examples of AuthException


Examples of com.cloudbees.cloud_resource.auth.AuthException

            Secure.Authenticator authenticator = secureAnnotation.with();
            if (authenticator == Secure.Authenticator.OAUTH) {
                return oauthAuthenticator.authenticate(containerRequest, secureAnnotation);
            } else {
                logger.error(String.format("Invalid authenticator  %s for method %s", authenticator, containerRequest.getPath()));
                throw new AuthException(500, "Invalid authenticator: " + authenticator);
            }
        }
View Full Code Here

Examples of com.datasift.client.exceptions.AuthException

                        }
                    }
                }
                result.setResponse(new com.datasift.client.Response(s, response));
                if (config.isAllowedToRaiseExceptions() && response.getStatus().code() == 401) {
                    throw new AuthException("Please provide a valid username and API key", response);
                }
                if (config.isAllowedToRaiseExceptions() && !result.isSuccessful()) {
                    throw new DataSiftException(result.getError(), result.failureCause());
                }
                future.received(result);
View Full Code Here

Examples of com.dbxml.labrador.exceptions.AuthException

            ctx.setProperty(PROP_USER, user);
            ctx.setProperty(PROP_PASS, pass);
            return true;
         }
         else
            throw new AuthException(HTTP.VALUE_BASIC, getAuthRealm(request));
      }
      else
         return true;
   }
View Full Code Here

Examples of com.feth.play.module.pa.exceptions.AuthException

  }

  private static AuthUser signupUser(final AuthUser u, final Session session, final AuthProvider provider) throws AuthException {
        final Object id = getUserService().save(u);
    if (id == null) {
      throw new AuthException(
          Messages.get("playauthenticate.core.exception.signupuser_failed"));
    }
        provider.afterSave(u, id, session);
    return u;
  }
View Full Code Here

Examples of com.liferay.portal.auth.AuthException

        if ( company.getAuthType().equals( Company.AUTH_TYPE_EA ) ) {

            //Verify that the System User is not been use to log in inside the system
            if ( systemUser.getEmailAddress().equalsIgnoreCase( login ) ) {
                SecurityLogger.logInfo(this.getClass(),"An invalid attempt to login as a System User has been made  - you cannot login as the System User");
                throw new AuthException( "Unable to login as System User - you cannot login as the System User." );
            }

            authResult = UserManagerUtil.authenticateByEmailAddress( company.getCompanyId(), login, password );
            userId = UserManagerUtil.getUserId( company.getCompanyId(), login );

        } else {

            //Verify that the System User is not been use to log in inside the system
            if ( systemUser.getUserId().equalsIgnoreCase( login ) ) {
                SecurityLogger.logInfo(this.getClass(),"An invalid attempt to login as a System User has been made  - you cannot login as the System User");
                throw new AuthException( "Unable to login as System User - you cannot login as the System User." );
            }

            authResult = UserManagerUtil.authenticateByUserId( company.getCompanyId(), login, password );
        }

    try {
      PrincipalFinder principalFinder =
        (PrincipalFinder)InstancePool.get(
          PropsUtil.get(PropsUtil.PRINCIPAL_FINDER));

      userId = principalFinder.fromLiferay(userId);
    }
    catch (Exception e) {
    }

    if (authResult == Authenticator.SUCCESS) {
      User user = UserLocalManagerUtil.getUserById(userId);
     
      //DOTCMS-4943
      UserAPI userAPI = APILocator.getUserAPI();     
      boolean respectFrontend = WebAPILocator.getUserWebAPI().isLoggedToBackend(req);     
      Locale userSelectedLocale = (Locale)req.getSession().getAttribute(Globals.LOCALE_KEY);     
      user.setLanguageId(userSelectedLocale.toString());
      userAPI.save(user, userAPI.getSystemUser(), respectFrontend);

      ses.setAttribute(WebKeys.USER_ID, userId);
     
      //DOTCMS-6392
      PreviewFactory.setVelocityURLS(req);
     
      //set the host to the domain of the URL if possible if not use the default host
      //http://jira.dotmarketing.net/browse/DOTCMS-4475
      try{
        String domainName = req.getServerName();
        Host h = null;
        h = APILocator.getHostAPI().findByName(domainName, user, false);
        if(h == null || !UtilMethods.isSet(h.getInode())){
          h = APILocator.getHostAPI().findByAlias(domainName, user, false);
        }
        if(h != null && UtilMethods.isSet(h.getInode())){
          req.getSession().setAttribute(com.dotmarketing.util.WebKeys.CMS_SELECTED_HOST_ID, h.getIdentifier());
        }else{
          req.getSession().setAttribute(com.dotmarketing.util.WebKeys.CMS_SELECTED_HOST_ID, APILocator.getHostAPI().findDefaultHost(APILocator.getUserAPI().getSystemUser(), true).getIdentifier());
        }
      }catch (DotSecurityException se) {
        req.getSession().setAttribute(com.dotmarketing.util.WebKeys.CMS_SELECTED_HOST_ID, APILocator.getHostAPI().findDefaultHost(APILocator.getUserAPI().getSystemUser(), true).getIdentifier());
      }
           
      ses.removeAttribute("_failedLoginName");
      Cookie idCookie = new Cookie(CookieKeys.ID,UserManagerUtil.encryptUserId(userId));
      idCookie.setPath("/");

     
      if (rememberMe) {
        idCookie.setMaxAge(31536000);
      }
      else {
        idCookie.setMaxAge(0);
      }
     


      res.addCookie(idCookie);

      EventsProcessor.process(PropsUtil.getArray(PropsUtil.LOGIN_EVENTS_PRE), req, res);
      EventsProcessor.process(PropsUtil.getArray(PropsUtil.LOGIN_EVENTS_POST), req, res);
     
    }

    if (authResult != Authenticator.SUCCESS) {
      //Logger.info(this, "An invalid attempt to login as " + login + " has been made from IP: " + req.getRemoteAddr());
      SecurityLogger.logInfo(this.getClass(),"An invalid attempt to login as " + login + " has been made from IP: " + req.getRemoteAddr());
      throw new AuthException();
    }
   
    //Logger.info(this, "User " + login + " has sucessfully login from IP: " + req.getRemoteAddr());
    SecurityLogger.logInfo(this.getClass(),"User " + login + " has sucessfully login from IP: " + req.getRemoteAddr());
  }
View Full Code Here

Examples of com.mucommander.commons.file.AuthException

            // Restore default cursor
            mainFrame.setCursor(Cursor.getDefaultCursor());

            if(e instanceof AuthException) {
              AuthException authException = (AuthException)e;
              // Retry (loop) if user provided new credentials, if not stop
              AuthDialog authDialog = popAuthDialog(authException.getURL(), true, authException.getMessage());
              newCredentialsMapping = authDialog.getCredentialsMapping();
              guestCredentialsSelected = authDialog.guestCredentialsSelected();

              if(newCredentialsMapping!=null) {
                // Invalidate the existing AbstractFile instance
View Full Code Here

Examples of com.sun.enterprise.security.jauth.AuthException

                 context.getSecurableSoapMessage().deleteSecurityHeader();

             } catch (XWSSecurityException xwsse) {
                xwsse.printStackTrace();
                throw new AuthException(xwsse.getMessage());
             }
       }
View Full Code Here

Examples of javax.security.auth.message.AuthException

                         sm.getString("authenticator.requestBodyTooBig"));
            }
            catch (IOException e)
            {
               log.error("Exception in Form authentication:",e);
               throw new AuthException(e.getLocalizedMessage());
            }
              return (AuthStatus.FAILURE);
          }
          forwardToLoginPage(request, response, config);
          return (AuthStatus.SEND_CONTINUE);
View Full Code Here

Examples of javax.security.auth.message.AuthException

            // if we found a valid user, initialize user id and groups
            if (userId != null) {
                try {
                    setupUser(client, userId);
                } catch (UnsupportedCallbackException uce) {
                    AuthException ae = new AuthException();
                    ae.initCause(uce);
                    throw ae;
                }
            } else if (requestPolicy.isMandatory()) {
                // otherwise, if the login is mandatory, it's a failure, since
                // there was no user id
                return AuthStatus.SEND_FAILURE;
            }
        } catch (IOException ioe) {
            AuthException ae = new AuthException();
            ae.initCause(ioe);
            throw ae;
        }

        // if we made it this far, we authenticated properly or authentication
        // wasn't required.  Good news!
View Full Code Here

Examples of javax.security.auth.message.AuthException

                WebLogger.WEB_SECURITY_LOGGER.tracef("Request body too big to save during authentication");
                try {
                    response.sendError(HttpServletResponse.SC_FORBIDDEN, sm.getString("authenticator.requestBodyTooBig"));
                } catch (IOException e) {
                 // Ignore IOException here (client disconnect)
                    throw new AuthException(e.getLocalizedMessage());
                }
                return (AuthStatus.FAILURE);
            }
            forwardToLoginPage(request, response, config);
            return (AuthStatus.SEND_CONTINUE);
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.