Examples of UnauthorisedException


Examples of com.createsend.util.exceptions.UnauthorisedException

          case NOT_FOUND:
              return new NotFoundException(apiResponse.Code, apiResponse.Message);
          case UNAUTHORIZED:
            if (apiResponse.Code == 121)
              return new ExpiredOAuthTokenException(apiResponse.Code, apiResponse.Message);
              return new UnauthorisedException(apiResponse.Code, apiResponse.Message);
          default:
              return new CreateSendHttpException(responseStatus);
      }
    }
View Full Code Here

Examples of com.createsend.util.exceptions.UnauthorisedException

          case NOT_FOUND:
              return new NotFoundException(apiResponse.Code, apiResponse.Message);
          case UNAUTHORIZED:
            if (apiResponse.Code == 121)
              return new ExpiredOAuthTokenException(apiResponse.Code, apiResponse.Message);
              return new UnauthorisedException(apiResponse.Code, apiResponse.Message);
          default:
              return new CreateSendHttpException(responseStatus);
      }
    }
View Full Code Here

Examples of com.google.nigori.common.UnauthorisedException

    }
  }

  private static void failure(Response response) throws IOException, UnauthorisedException {
    if (response.resp.getResponseCode() == Http.UNAUTHORIZED) {
      throw new UnauthorisedException(response.jsonResponse);
    }
    throw new IOException("Server did not accept request(" + response.resp.getResponseCode()
        + "). " + response.jsonResponse);
  }
View Full Code Here

Examples of com.google.nigori.common.UnauthorisedException

        JsonConversionException, IOException, UnauthorisedException {
      String json = getJsonAsString(req, maxJsonQueryLength);
      AuthenticateRequest auth = MessageLibrary.authenticateRequestFromJson(json);
      boolean success = protocol.authenticate(auth);
      if (!success) {
        throw new UnauthorisedException("Authorisation failed");
      }

      emptyBody(resp);
    }
View Full Code Here

Examples of com.google.nigori.common.UnauthorisedException

            try {
              return database.getUser(publicHash);
            } catch (UserNotFoundException e) {
              // TODO(drt24): potential security vulnerability - user existence oracle.
              // Should not happen often - is only possible due to concurrency
              throw new UnauthorisedException("No such user");
            }
          } else {
            throw new UnauthorisedException("Invalid nonce or no such user");
          }
        } else {
          throw new UnauthorisedException("The signature is invalid");
        }
      } catch (NoSuchAlgorithmException nsae) {
        severe("authenticateUser",nsae);
        throw new CryptoException("Internal error attempting to verify signature");
      }
    } catch (UserNotFoundException e1) {
      warning("authenticateUser",e1);
      throw new UnauthorisedException("No such user");
    }
  }
View Full Code Here

Examples of org.mule.api.security.UnauthorisedException

        HttpBasicAuthenticationFilter filter = new HttpBasicAuthenticationFilter();

        SecurityManager manager = mock(SecurityManager.class);
        filter.setSecurityManager(manager);

        doThrow(new UnauthorisedException(null, (MuleEvent) null)).when(manager).authenticate(
            (Authentication) anyObject());

        try
        {
            filter.authenticateInbound(event);
View Full Code Here

Examples of org.mule.api.security.UnauthorisedException

        SecurityProviderNotFoundException, EncryptionStrategyNotFoundException, InitialisationException
    {
        Authentication auth = event.getSession().getSecurityContext().getAuthentication();
        if (auth == null)
        {
            throw new UnauthorisedException(CoreMessages.authNoCredentials());
        }

        if (!(auth instanceof SpringAuthenticationAdapter))
        {
            throw new UnauthorisedException(SpringSecurityMessages.springAuthenticationRequired());
        }

        SpringAuthenticationAdapter springAuth = (SpringAuthenticationAdapter) auth;

        String principalName = springAuth.getName();
View Full Code Here

Examples of org.mule.api.security.UnauthorisedException

    {

        public TestSecurityEvent(MuleContext muleContext)
        {
            super(
                new UnauthorisedException(CoreMessages.createStaticMessage("dummy"), new DefaultMuleEvent(
                    new DefaultMuleMessage(NullPayload.getInstance(), muleContext), MessageExchangePattern.REQUEST_RESPONSE,
                    null)), 0);
        }
View Full Code Here

Examples of org.mule.api.security.UnauthorisedException

        {
            Map<?, ?> payload = event.getMessage().getPayload(DataTypeFactory.create(Map.class));
            String user = (String) payload.get("user");
            if (user == null)
            {
                throw new UnauthorisedException(CoreMessages.authNoCredentials());
            }
            if ("anonymous".equals(user))
            {
                throw new UnauthorisedException(CoreMessages.authFailedForUser("anonymous"));
            }
        }
        catch (Exception e)
        {
            throw new UnauthorisedException(CoreMessages.authFailedForUser("anonymous"), e);
        }

    }
View Full Code Here

Examples of org.mule.api.security.UnauthorisedException

            if (logger.isDebugEnabled())
            {
                logger.debug("Authentication request for user: " + user.getUsername()
                    + " failed: " + e.toString());
            }
            throw new UnauthorisedException(
                CoreMessages.authFailedForUser(user.getUsername()), event, e);
        }

        // Authentication success
        if (logger.isDebugEnabled())
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.