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);

    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();
      }
    });

    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

    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 String method = "createToken";
    // FIXME: This is so gross that I have to do this. Shindig needs to be fixed so I can
    // consistently get the container from tokenParameters.
    String token = tokenParameters.get(SecurityTokenCodec.SECURITY_TOKEN_NAME);
    if (token == null || token.length() == 0) {
      return new AnonymousSecurityToken();
    }

    String[] tokenParts = token.split(":");
    String container;
    if (tokenParts.length == 2) {
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

Examples of org.apache.shindig.auth.AnonymousSecurityToken

    assertEquals("2.3.4.5", context.getUserIp());
  }

  @Test
  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

      return null;
    }
    try {
      if (normalizedReq.getAccessToken() != null) {
        store.validateRequestForResource(normalizedReq, null);
        return new AnonymousSecurityToken(); // Return your valid security token
      }
    } catch (OAuth2Exception oae) {
      // TODO (Eric): process OAuth2Exception properly
      throw new InvalidAuthenticationException("Something went wrong: ", oae);
    }
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

    assertEquals("2.3.4.5", context.getUserIp());
  }

  @Test
  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
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.