Examples of AnonymousSecurityToken


Examples of org.apache.shindig.auth.AnonymousSecurityToken

  protected T fetchFromNetwork(Query query) throws SpecRetrievalFailedException, GadgetException {
    HttpRequest request = new HttpRequest(query.specUri)
        .setIgnoreCache(query.ignoreCache)
        .setGadget(query.gadgetUri)
        .setContainer(query.container)
        .setSecurityToken( new AnonymousSecurityToken("", 0L, query.gadgetUri.toString(), 0L));

    // Since we don't allow any variance in cache time, we should just force the cache time
    // globally. This ensures propagation to shared caches when this is set.
    request.setCacheTtl((int) (refresh / 1000));
View Full Code Here

Examples of org.apache.shindig.auth.AnonymousSecurityToken

    try {
      EasyMock.expect(
          mockStore.getSecurityTokenForConsumerRequest(
              EasyMock.eq(FakeOAuthRequest.CONSUMER_KEY),
              EasyMock.eq(FakeOAuthRequest.REQUESTOR))).andReturn(
          new AnonymousSecurityToken());
    } catch (OAuthProblemException e) {
      // ignore
    }
  }
View Full Code Here

Examples of org.apache.shindig.auth.AnonymousSecurityToken

  protected T fetchFromNetwork(Query query) throws SpecRetrievalFailedException, GadgetException {
    HttpRequest request = new HttpRequest(query.specUri)
        .setIgnoreCache(query.ignoreCache)
        .setGadget(query.gadgetUri)
        .setContainer(query.container)
        .setSecurityToken( new AnonymousSecurityToken("", 0L, query.gadgetUri.toString()));

    // Since we don't allow any variance in cache time, we should just force the cache time
    // globally. This ensures propagation to shared caches when this is set.
    request.setCacheTtl((int) (refresh / 1000));
View Full Code Here

Examples of org.apache.shindig.auth.AnonymousSecurityToken

    }

    final HttpRequest request = new HttpRequest(Uri.parse(completeAuthorizationUrl));
    request.setMethod("GET");
    request.setHeader("Content-Type", "application/x-www-form-urlencoded; charset=utf-8");
    request.setSecurityToken( new AnonymousSecurityToken( "", 0L, accessor.getGadgetUri()));

    for (final ClientAuthenticationHandler clientAuthenticationHandler : this.clientAuthenticationHandlers) {
      if (clientAuthenticationHandler.geClientAuthenticationType().equalsIgnoreCase(
              accessor.getClientAuthenticationType())) {
        final OAuth2HandlerError error = clientAuthenticationHandler.addOAuth2Authentication(
View Full Code Here

Examples of org.apache.shindig.auth.AnonymousSecurityToken

            .getTokenUrl());

    final HttpRequest request = new HttpRequest(Uri.parse(tokenUrl));
    request.setMethod("POST");
    request.setHeader("Content-Type", "application/x-www-form-urlencoded; charset=utf-8");
    request.setSecurityToken(new AnonymousSecurityToken("", 0L, accessor.getGadgetUri()));

    if (!isUriAllowed(request.getUri(), accessor.getAllowedDomains())) {
      ret = new OAuth2HandlerError(OAuth2Error.AUTHORIZATION_CODE_PROBLEM,
              "Exception exchanging authorization code for access_token - domain not allowed", null);
    }
View Full Code Here

Examples of org.apache.shindig.auth.AnonymousSecurityToken

  protected T fetchFromNetwork(Query query) throws SpecRetrievalFailedException, GadgetException {
    HttpRequest request = new HttpRequest(query.specUri)
        .setIgnoreCache(query.ignoreCache)
        .setGadget(query.gadgetUri)
        .setContainer(query.container)
        .setSecurityToken( new AnonymousSecurityToken("", 0L, query.gadgetUri.toString()));

    // Since we don't allow any variance in cache time, we should just force the cache time
    // globally. This ensures propagation to shared caches when this is set.
    request.setCacheTtl((int) (refresh / 1000));
View Full Code Here

Examples of org.apache.shindig.auth.AnonymousSecurityToken

  /** {@inheritDoc} */
  public void contribute(Map<String,Object> config, String container, String host) {
    // TODO: This currently will throw an exception when using BlobCrypterSecurityTokens...
    // It seems to be ok for now, we need some good token cleanup.
    SecurityToken containerToken = new AnonymousSecurityToken(container, 0L, "*");
    Map<String, String> authConfig = Maps.newHashMapWithExpectedSize(2);

    try {
      config.put("shindig.auth", authConfig);
      authConfig.put("authToken", securityTokenCodec.encodeToken(containerToken));
View Full Code Here

Examples of org.apache.shindig.auth.AnonymousSecurityToken

    }

    if (refershTokenUrl != null) {
      HttpResponse response = null;
      final HttpRequest request = new HttpRequest(Uri.parse(refershTokenUrl));
      request.setSecurityToken(new AnonymousSecurityToken("", 0L, accessor.getGadgetUri()));
      request.setMethod("POST");
      request.setHeader("Content-Type", "application/x-www-form-urlencoded; charset=utf-8");

      for (final ClientAuthenticationHandler clientAuthenticationHandler : this.clientAuthenticationHandlers) {
        if (clientAuthenticationHandler.geClientAuthenticationType().equalsIgnoreCase(
View Full Code Here

Examples of org.apache.shindig.auth.AnonymousSecurityToken

      this.parsedXmlCache = cacheProvider.createCache(PARSED_XML_CACHE);
    }
  }

  public TemplateLibrary loadTemplateLibrary(GadgetContext context, Uri uri) throws GadgetException {
    HttpRequest request = new HttpRequest(uri).setSecurityToken( new AnonymousSecurityToken( "", 0L, context.getUrl().toString()));
    // 5 minute TTL.
    request.setCacheTtl(300);
    request.setIgnoreCache(context.getIgnoreCache());
    HttpResponse response = pipeline.execute(request);
    if (response.getHttpStatusCode() != HttpResponse.SC_OK) {
View Full Code Here

Examples of org.apache.shindig.auth.AnonymousSecurityToken

            .getTokenUrl());

    final HttpRequest request = new HttpRequest(Uri.parse(tokenUrl));
    request.setMethod("POST");
    request.setHeader("Content-Type", "application/x-www-form-urlencoded; charset=utf-8");
    request.setSecurityToken(new AnonymousSecurityToken("", 0L, accessor.getGadgetUri()));

    if (!OAuth2Utils.isUriAllowed(request.getUri(), accessor.getAllowedDomains())) {
      ret = new OAuth2HandlerError(OAuth2Error.AUTHORIZATION_CODE_PROBLEM,
              "Exception exchanging authorization code for access_token - domain not allowed", null);
    }
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.