Examples of AnonymousSecurityToken


Examples of org.apache.shindig.auth.AnonymousSecurityToken

        .setContainer("container")
        .setGadget(DEFAULT_URI)
        .setMethod("POST")
        .setPostBody(POST_BODY.getBytes())
        .setRewriteMimeType("text/fake")
        .setSecurityToken(new AnonymousSecurityToken())
        .setOAuthArguments(oauthArguments)
        .setAuthType(AuthType.OAUTH)
        .setFollowRedirects(false)
        .setInternalRequest(true);
View Full Code Here

Examples of org.apache.shindig.auth.AnonymousSecurityToken

        return new Locale("foo", "BAR");
      }

      @Override
      public SecurityToken getToken() {
        return new AnonymousSecurityToken();
      }
    });

    pipeline.plainResponses.put(uri.toUri(), new HttpResponse(PROXIED_HTML_CONTENT));
    String content = proxyRenderer.render(gadget);
View Full Code Here

Examples of org.apache.shindig.auth.AnonymousSecurityToken

        .setContainer("container")
        .setGadget(DEFAULT_URI)
        .setMethod("POST")
        .setPostBody(POST_BODY.getBytes())
        .setRewriteMimeType("text/fake")
        .setSecurityToken(new AnonymousSecurityToken())
        .setOAuthArguments(oauthArguments)
        .setAuthType(AuthType.OAUTH)
        .setFollowRedirects(false);

    HttpRequest request2 = new HttpRequest(request).setUri(Uri.parse("http://example.org/foo"));
View Full Code Here

Examples of org.apache.shindig.auth.AnonymousSecurityToken

        return new Locale("foo", "BAR");
      }

      @Override
      public SecurityToken getToken() {
        return new AnonymousSecurityToken();
      }
    });

    fetcher.plainResponses.put(uri.toUri(), new HttpResponse(PROXIED_HTML_CONTENT));
    String content = renderer.render(gadget);
View Full Code Here

Examples of org.apache.shindig.auth.AnonymousSecurityToken

    GadgetContext context = new HttpGadgetContext(request);
    assertEquals("2.3.4.5", context.getUserIp());
  }

  public void testGetSecurityToken() throws Exception {
    SecurityToken expected = new AnonymousSecurityToken();
    expect(request.getAttribute(AuthInfo.Attribute.SECURITY_TOKEN.getId())).andReturn(expected);
    replay();
    GadgetContext context = new HttpGadgetContext(request);
    assertEquals(expected, context.getToken());
  }
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

    }

    final HttpRequest request = new HttpRequest(Uri.parse(completeAuthorizationUrl));
    request.setMethod("POST");
    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

  }

  /** {@inheritDoc} */
  public void contribute(Map<String,Object> config, String container, String host) {
    // Inject an anonymous security token TODO set TTL based on cachability of this JS?
    SecurityToken containerToken = new AnonymousSecurityToken(container, 0,"*", 1000L * 60 * 60 * 24);
    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

  private void expectSecurityToken() {
    try {
      EasyMock.expect(mockStore.getSecurityTokenForConsumerRequest(
          EasyMock.eq(FakeOAuthRequest.CONSUMER_KEY), EasyMock.eq(FakeOAuthRequest.REQUESTOR))).
            andReturn(new AnonymousSecurityToken());
    } catch (OAuthProblemException e) {

    }
  }
View Full Code Here

Examples of org.apache.shindig.auth.AnonymousSecurityToken

  private void expectSecurityToken() {
    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
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.