Package org.springframework.social

Examples of org.springframework.social.InvalidAuthorizationException


      } else if (message.equals("An active access token must be used to query information about the current user.")) {
        throw new MissingAuthorizationException(FACEBOOK);
      } else if (message.startsWith("Error validating access token")) {
        handleInvalidAccessToken(message);
      } else if (message.equals("Invalid access token signature.")) { // Access token that fails signature validation
        throw new InvalidAuthorizationException(FACEBOOK, message);
      } else if (message.contains("Application does not have the capability to make this API call.") || message.contains("App must be on whitelist")) {
        throw new OperationNotPermittedException(FACEBOOK, message);
      } else if (message.contains("Invalid fbid") || message.contains("The parameter url is required")) {
        throw new OperationNotPermittedException(FACEBOOK, "Invalid object for this operation");
      } else if (message.contains("Duplicate status message") ) {
        throw new DuplicateStatusException(FACEBOOK, message);
      } else if (message.contains("Feed action request limit reached")) {
        throw new RateLimitExceededException(FACEBOOK);
      } else if (message.contains("The status you are trying to publish is a duplicate of, or too similar to, one that we recently posted to Twitter")) {
        throw new DuplicateStatusException(FACEBOOK, message);
      }
    } else if (statusCode == HttpStatus.UNAUTHORIZED) {
      if (message.startsWith("Error validating access token")) {
        handleInvalidAccessToken(message);
      } else if (message.equals("Invalid OAuth access token.")) {  // Bogus access token
        throw new InvalidAuthorizationException(FACEBOOK, message);
      } else if (message.startsWith("Error validating application.")) { // Access token with incorrect app ID
        throw new InvalidAuthorizationException(FACEBOOK, message);
      }
      throw new NotAuthorizedException(FACEBOOK, message);
    } else if (statusCode == HttpStatus.FORBIDDEN) {
      if (message.contains("Requires extended permission")) {
        throw new InsufficientPermissionException(FACEBOOK, message.split(": ")[1]);
View Full Code Here


    } else if (message.contains("The session was invalidated explicitly using an API call.")) {
      throw new RevokedAuthorizationException("facebook", message);
    } else if (message.contains("Session does not match current stored session.")) {
      throw new RevokedAuthorizationException("facebook", message);
    } else {
      throw new InvalidAuthorizationException("facebook", message);
    }
  }
View Full Code Here

TOP

Related Classes of org.springframework.social.InvalidAuthorizationException

Copyright © 2018 www.massapicom. 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.