Examples of AnonymousSecurityToken


Examples of org.apache.shindig.auth.AnonymousSecurityToken

   * @return the security token for the request
   * @throws InvalidAuthenticationException if the token can not be created
   */
  protected SecurityToken createSecurityTokenForValidatedRequest(OAuth2NormalizedRequest request)
      throws InvalidAuthenticationException {
    return new AnonymousSecurityToken(); // Return your valid security token
  }
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(AuthInfoUtil.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 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

    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

    }

    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);
    HttpResponse response = pipeline.execute(request);
    if (response.getHttpStatusCode() != HttpResponse.SC_OK) {
      int retcode = response.getHttpStatusCode();
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

    request.setMethod(accessorInfo.getHttpMethod().toString());
    if (accessorInfo.getHttpMethod() == HttpMethod.POST) {
      request.setHeader("Content-Type", OAuth.FORM_ENCODED);
    }

    request.setSecurityToken( new AnonymousSecurityToken( "", 0L, this.realRequest.getSecurityToken().getAppUrl()));
    return request;
  }
View Full Code Here

Examples of org.apache.shindig.auth.AnonymousSecurityToken

      throw new OAuthRequestException(OAuthError.BAD_OAUTH_TOKEN_URL, "access token");
    }
    Uri accessTokenUri = Uri.parse(accessor.consumer.serviceProvider.accessTokenURL);
    HttpRequest request = new HttpRequest(accessTokenUri);
    request.setMethod(accessorInfo.getHttpMethod().toString());
    request.setSecurityToken( new AnonymousSecurityToken( "", 0L, this.realRequest.getSecurityToken().getAppUrl()));
    if (accessorInfo.getHttpMethod() == HttpMethod.POST) {
      request.setHeader("Content-Type", OAuth.FORM_ENCODED);
    }

    List<Parameter> msgParams = Lists.newArrayList();
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.