Package com.feth.play.module.pa.exceptions

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


      throws AccessTokenException {
    final JsonNode n = r.asJson();
    Logger.debug(n.toString());

    if (n.get(OAuth2AuthProvider.Constants.ERROR) != null) {
      throw new AccessTokenException(n.get(
          OAuth2AuthProvider.Constants.ERROR).asText());
    } else {
      return new GoogleAuthInfo(n);
    }
  }
View Full Code Here


  @Override
  protected FoursquareAuthInfo buildInfo(final WSResponse r)
      throws AccessTokenException {

    if (r.getStatus() >= 400) {
      throw new AccessTokenException(r.toString());
    } else {
      final JsonNode result = r.asJson();
      Logger.debug(result.asText());
      return new FoursquareAuthInfo(result.get(
          OAuth2AuthProvider.Constants.ACCESS_TOKEN).asText());
View Full Code Here

      throws AccessTokenException {
    final JsonNode n = r.asJson();

    final JsonNode meta = n.get(NODE_META);
    if (meta.get(ERROR_TYPE) != null) {
      throw new AccessTokenException(meta.get(ERROR_DETAIL).asText());
    } else {
      return new UntappdAuthInfo(n.get(NODE_RESPONSE)
          .get(Constants.ACCESS_TOKEN).asText());
    }
  }
View Full Code Here

      throws AccessTokenException {
    final JsonNode n = r.asJson();
    Logger.debug(n.toString());

    if (n.get(OAuth2AuthProvider.Constants.ERROR) != null) {
      throw new AccessTokenException(n.get(
          OAuth2AuthProvider.Constants.ERROR).asText());
    } else {
      return new VkAuthInfo(n);
    }
  }
View Full Code Here

    protected GithubAuthInfo buildInfo(final WSResponse r)
            throws AccessTokenException {
        final JsonNode n = r.asJson();

        if (n.get(Constants.ERROR) != null) {
            throw new AccessTokenException(n.get(
                    Constants.ERROR).asText());
        } else {
            return new GithubAuthInfo(n);
        }
    }
View Full Code Here

  @Override
  protected FacebookAuthInfo buildInfo(final WSResponse r)
      throws AccessTokenException {
    if (r.getStatus() >= 400) {
      throw new AccessTokenException(r.asJson().get(ERROR).get(MESSAGE).asText());
    } else {
      final String query = r.getBody();
      Logger.debug(query);
      final List<NameValuePair> pairs = URLEncodedUtils.parse(
          URI.create("/?" + query), "utf-8");
      if (pairs.size() < 2) {
        throw new AccessTokenException();
      }
      final Map<String, String> m = new HashMap<String, String>(
          pairs.size());
      for (final NameValuePair nameValuePair : pairs) {
        m.put(nameValuePair.getName(), nameValuePair.getValue());
View Full Code Here

    @Override
    protected EventBriteAuthInfo buildInfo(WSResponse r)
            throws AccessTokenException {
        if (r.getStatus() >= 400) {
            throw new AccessTokenException(r.toString());
        } else {
            final JsonNode result = r.asJson();
            Logger.debug(result.asText());
            return new EventBriteAuthInfo(result.get(
                    OAuth2AuthProvider.Constants.ACCESS_TOKEN).asText());
View Full Code Here

  @Override
  protected PocketAuthInfo buildInfo(final WSResponse r)
      throws AccessTokenException {
    if (r.getStatus() >= 400) {
      throw new AccessTokenException(r.asJson().asText());
    } else {
      final List<NameValuePair> list = URLEncodedUtils.parse(r.getBody(),
          Charset.forName("UTF-8"));
      final Map<String, String> map = new HashMap<String, String>(
          list.size());
View Full Code Here

TOP

Related Classes of com.feth.play.module.pa.exceptions.AccessTokenException

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.