Package org.apache.shindig.gadgets.spec

Examples of org.apache.shindig.gadgets.spec.OAuthService


    if (oauthSpec == null) {
      throw responseParams.oauthRequestException(OAuthError.BAD_OAUTH_CONFIGURATION,
          "Failed to retrieve OAuth URLs, spec for gadget " +
          securityToken.getAppUrl() + " does not contain OAuth element.");
    }
    OAuthService service = oauthSpec.getServices().get(arguments.getServiceName());
    if (service == null) {
      throw responseParams.oauthRequestException(OAuthError.BAD_OAUTH_CONFIGURATION,
          "Failed to retrieve OAuth URLs, spec for gadget does not contain OAuth service " +
          arguments.getServiceName() + ".  Known services: " +
          StringUtils.join(oauthSpec.getServices().keySet(), ',') + '.');
    }
    // In theory some one could specify different parameter locations for request token and
    // access token requests, but that's probably not useful.  We just use the request token
    // rules for everything.
    accessorBuilder.setParameterLocation(
        getStoreLocation(service.getRequestUrl().location, responseParams));
    accessorBuilder.setMethod(getStoreMethod(service.getRequestUrl().method, responseParams));
    return new OAuthServiceProvider(
        service.getRequestUrl().url.toJavaUri().toASCIIString(),
        service.getAuthorizationUrl().toJavaUri().toASCIIString(),
        service.getAccessUrl().url.toJavaUri().toASCIIString());
  }
View Full Code Here


    if (oauthSpec == null) {
      throw responseParams.oauthRequestException(OAuthError.BAD_OAUTH_CONFIGURATION,
          "Failed to retrieve OAuth URLs, spec for gadget " +
          securityToken.getAppUrl() + " does not contain OAuth element.");
    }
    OAuthService service = oauthSpec.getServices().get(arguments.getServiceName());
    if (service == null) {
      throw responseParams.oauthRequestException(OAuthError.BAD_OAUTH_CONFIGURATION,
          "Failed to retrieve OAuth URLs, spec for gadget does not contain OAuth service " +
          arguments.getServiceName() + ".  Known services: " +
          StringUtils.join(oauthSpec.getServices().keySet(), ',') + '.');
    }
    // In theory some one could specify different parameter locations for request token and
    // access token requests, but that's probably not useful.  We just use the request token
    // rules for everything.
    accessorBuilder.setParameterLocation(
        getStoreLocation(service.getRequestUrl().location, responseParams));
    accessorBuilder.setMethod(getStoreMethod(service.getRequestUrl().method, responseParams));
    return new OAuthServiceProvider(
        service.getRequestUrl().url.toJavaUri().toASCIIString(),
        service.getAuthorizationUrl().toJavaUri().toASCIIString(),
        service.getAccessUrl().url.toJavaUri().toASCIIString());
  }
View Full Code Here

    if (oauthSpec == null) {
      throw new OAuthRequestException(OAuthError.BAD_OAUTH_CONFIGURATION,
          "Failed to retrieve OAuth URLs, spec for gadget " +
          securityToken.getAppUrl() + " does not contain OAuth element.");
    }
    OAuthService service = oauthSpec.getServices().get(arguments.getServiceName());
    if (service == null) {
      throw new OAuthRequestException(OAuthError.BAD_OAUTH_CONFIGURATION,
          "Failed to retrieve OAuth URLs, spec for gadget does not contain OAuth service " +
          arguments.getServiceName() + ".  Known services: " +
          Joiner.on(',').join(oauthSpec.getServices().keySet()) + '.');
    }
    // In theory some one could specify different parameter locations for request token and
    // access token requests, but that's probably not useful.  We just use the request token
    // rules for everything.
    accessorBuilder.setParameterLocation(
        getStoreLocation(service.getRequestUrl().location, responseParams));
    accessorBuilder.setMethod(getStoreMethod(service.getRequestUrl().method, responseParams));
    return new OAuthServiceProvider(
        service.getRequestUrl().url.toJavaUri().toASCIIString(),
        service.getAuthorizationUrl().toJavaUri().toASCIIString(),
        service.getAccessUrl().url.toJavaUri().toASCIIString());
  }
View Full Code Here

    if (oauthSpec == null) {
      throw new OAuthRequestException(OAuthError.BAD_OAUTH_CONFIGURATION,
          "Failed to retrieve OAuth URLs, spec for gadget " +
          securityToken.getAppUrl() + " does not contain OAuth element.");
    }
    OAuthService service = oauthSpec.getServices().get(arguments.getServiceName());
    if (service == null) {
      throw new OAuthRequestException(OAuthError.BAD_OAUTH_CONFIGURATION,
          "Failed to retrieve OAuth URLs, spec for gadget does not contain OAuth service " +
          arguments.getServiceName() + ".  Known services: " +
          Joiner.on(',').join(oauthSpec.getServices().keySet()) + '.');
    }
    // In theory some one could specify different parameter locations for request token and
    // access token requests, but that's probably not useful.  We just use the request token
    // rules for everything.
    accessorBuilder.setParameterLocation(
        getStoreLocation(service.getRequestUrl().location, responseParams));
    accessorBuilder.setMethod(getStoreMethod(service.getRequestUrl().method, responseParams));
    return new OAuthServiceProvider(
        service.getRequestUrl().url.toJavaUri().toASCIIString(),
        service.getAuthorizationUrl().toJavaUri().toASCIIString(),
        service.getAccessUrl().url.toJavaUri().toASCIIString());
  }
View Full Code Here

    GadgetSpec spec = findSpec(securityToken, arguments);
    OAuthSpec oauthSpec = spec.getModulePrefs().getOAuthSpec();
    if (oauthSpec == null) {
      throw oauthNotFoundEx(securityToken);
    }
    OAuthService service = oauthSpec.getServices().get(arguments.getServiceName());
    if (service == null) {
      throw serviceNotFoundEx(securityToken, oauthSpec, arguments.getServiceName());
    }
    // In theory some one could specify different parameter locations for request token and
    // access token requests, but that's probably not useful.  We just use the request token
    // rules for everything.
    accessorBuilder.setParameterLocation(getStoreLocation(service.getRequestUrl().location));
    accessorBuilder.setMethod(getStoreMethod(service.getRequestUrl().method));
    OAuthServiceProvider provider = new OAuthServiceProvider(
        service.getRequestUrl().url.toJavaUri().toASCIIString(),
        service.getAuthorizationUrl().toJavaUri().toASCIIString(),
        service.getAccessUrl().url.toJavaUri().toASCIIString());
    return provider;
  }
View Full Code Here

    if (oauthSpec == null) {
      throw new OAuthRequestException(OAuthError.BAD_OAUTH_CONFIGURATION,
          "Failed to retrieve OAuth URLs, spec for gadget " +
          securityToken.getAppUrl() + " does not contain OAuth element.");
    }
    OAuthService service = oauthSpec.getServices().get(arguments.getServiceName());
    if (service == null) {
      throw new OAuthRequestException(OAuthError.BAD_OAUTH_CONFIGURATION,
          "Failed to retrieve OAuth URLs, spec for gadget does not contain OAuth service " +
          arguments.getServiceName() + ".  Known services: " +
          StringUtils.join(oauthSpec.getServices().keySet(), ',') + '.');
    }
    // In theory some one could specify different parameter locations for request token and
    // access token requests, but that's probably not useful.  We just use the request token
    // rules for everything.
    accessorBuilder.setParameterLocation(
        getStoreLocation(service.getRequestUrl().location, responseParams));
    accessorBuilder.setMethod(getStoreMethod(service.getRequestUrl().method, responseParams));
    return new OAuthServiceProvider(
        service.getRequestUrl().url.toJavaUri().toASCIIString(),
        service.getAuthorizationUrl().toJavaUri().toASCIIString(),
        service.getAccessUrl().url.toJavaUri().toASCIIString());
  }
View Full Code Here

TOP

Related Classes of org.apache.shindig.gadgets.spec.OAuthService

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.