Examples of NotAuthorizedException


Examples of com.bradmcevoy.http.exceptions.NotAuthorizedException

            return;
        }
        if( lockToken.tokenId.equals( tokenId ) ) {
            removeLock( lockToken );
        } else {
            throw new NotAuthorizedException( resource );
        }
    }
View Full Code Here

Examples of com.bradmcevoy.http.exceptions.NotAuthorizedException

                vtf=null;
            }
           
        } catch (PermissionDeniedException e) {
            LOG.debug(e.getMessage());
            throw new NotAuthorizedException(this);
           
        } finally {
            IOUtils.closeQuietly(out);
        }
    }
View Full Code Here

Examples of com.bradmcevoy.http.exceptions.NotAuthorizedException

            LockToken mltonLT = convertToken(existLT);
            lr = LockResult.success(mltonLT);

        } catch (PermissionDeniedException ex) {
            LOG.debug(ex.getMessage());
            throw new NotAuthorizedException(this);

        } catch (DocumentAlreadyLockedException ex) {
            // set result iso throw new LockedException(this);
            LOG.debug(ex.getMessage());
            lr = LockResult.failed(LockResult.FailureReason.ALREADY_LOCKED);
View Full Code Here

Examples of com.bradmcevoy.http.exceptions.NotAuthorizedException

            LockToken mltonLT = convertToken(existLT);
            lr = LockResult.success(mltonLT);

        } catch (PermissionDeniedException ex) {
            LOG.debug(ex.getMessage());
            throw new NotAuthorizedException(this);

        } catch (DocumentNotLockedException | EXistException ex) {
            LOG.debug(ex.getMessage());
            lr = LockResult.failed(LockResult.FailureReason.PRECONDITION_FAILED);
View Full Code Here

Examples of com.bradmcevoy.http.exceptions.NotAuthorizedException

       
        try {
            existDocument.unlock();
        } catch (PermissionDeniedException ex) {
            LOG.debug(ex.getMessage());
            throw new NotAuthorizedException(this);

        } catch (DocumentNotLockedException | EXistException ex) {
            LOG.debug(ex.getMessage());
            throw new PreConditionFailedException(this);
View Full Code Here

Examples of com.bradmcevoy.http.exceptions.NotAuthorizedException

            XmldbURI collectionURI = existCollection.createCollection(name);
            collection = new MiltonCollection(host, collectionURI, brokerPool, subject);

        } catch (PermissionDeniedException ex) {
            LOG.debug(ex.getMessage());
            throw new NotAuthorizedException(this);

        } catch (CollectionExistsException | EXistException ex) {
            LOG.debug(ex.getMessage());
            throw new ConflictException(this);
View Full Code Here

Examples of com.caucho.bam.NotAuthorizedException

      else if (_security.isSystemAuthKey() || ! _isAuthenticationRequired)
        serverSignature = _security.signSystem(uid, nonce);
      else {
        log.info("Authentication failed because no resin-system-auth-key");
       
        throw new NotAuthorizedException(L.l("'{0}' has invalid credentials",
                                             uid));
      }
     
      if (! serverSignature.equals(signature)) {
        throw new NotAuthorizedException(L.l("'{0}' has invalid credentials",
                                             uid));
      }
    }
    else if (auth == null && ! _isAuthenticationRequired) {
    }
    else if (auth == null) {
      log.finer("Authentication failed because no authenticator configured");
     
      throw new NotAuthorizedException(L.l("'{0}' has missing authenticator",
                                           credentials));
    }
    else if (credentials instanceof DigestCredentials) {
      DigestCredentials digestCred = (DigestCredentials) credentials;

      Principal user = new BasicPrincipal(digestCred.getUserName());
     
      user = auth.authenticate(user, digestCred, null);

      if (user == null) {
        throw new NotAuthorizedException(L.l("'{0}' has invalid digest credentials",
                                             digestCred.getUserName()));
      }
    }
    else if (credentials instanceof String) {
      String password = (String) credentials;
   
      Principal user = new BasicPrincipal(to);
      PasswordCredentials pwdCred = new PasswordCredentials(password);
   
      if (auth.authenticate(user, pwdCred, null) == null) {
        throw new NotAuthorizedException(L.l("'{0}' has invalid password credentials",
                                             to));
      }
    }
    /*
    else if (server.getAdminCookie() == null && credentials == null) {
      if (! "127.0.0.1".equals(ipAddress)) {
        throw new NotAuthorizedException(L.l("'{0}' is an invalid local address for '{1}', because no password credentials are available",
                                             ipAddress, uid));
      }
    }
    */
    else {
      throw new NotAuthorizedException(L.l("'{0}' is an unknown credential",
                                           credentials));
    }
  }
View Full Code Here

Examples of com.dotcms.repackage.com.bradmcevoy.http.exceptions.NotAuthorizedException

        } else if (result >= 400 && result < 500) {
            switch (result) {
                case 400:
                    throw new BadRequestException(href);
                case 401:
                    throw new NotAuthorizedException(href,null);
                case 403:
                    throw new NotAuthorizedException(href,null);
                case 404:
                    throw new NotFoundException(href);
                case 405:
                    throw new MethodNotAllowedException(result, href);
                case 409:
View Full Code Here

Examples of com.esri.gpt.framework.security.identity.NotAuthorizedException

      HrRecords records = select.getQueryResult().getRecords();
      if (records.size() > 0) {
        HrRecord oldRecord = records.get(0);
        if (user.getLocalID()!=oldRecord.getOwnerId()) {
          if (!user.getIsAdministrator()) {
            throw new NotAuthorizedException("Not authorized.");
          }
        }
        if (record.getHostUrl().equals(oldRecord.getHostUrl())) {
          hostUrlChanged = false;
        }
View Full Code Here

Examples of com.taskadapter.redmineapi.NotAuthorizedException

    if (responseCode == HttpStatus.SC_UNAUTHORIZED) {
      throw new RedmineAuthenticationException(
          "Authorization error. Please check if you provided a valid API access key or Login and Password and REST API service is enabled on the server.");
    }
    if (responseCode == HttpStatus.SC_FORBIDDEN) {
      throw new NotAuthorizedException(
          "Forbidden. Please check the user has proper permissions.");
    }
    if (responseCode == HttpStatus.SC_NOT_FOUND) {
      throw new NotFoundException(
          "Server returned '404 not found'. response body:"
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.