Package org.apache.shindig.gadgets.oauth

Examples of org.apache.shindig.gadgets.oauth.OAuthArguments


        + "authz: 'oauth' }"
        + "}}");
    HttpRequest httpRequest = new HttpRequest(Uri.parse("http://www.example.org/somecontent"));
    httpRequest.setMethod("POST");
    httpRequest.setAuthType(AuthType.OAUTH);
    OAuthArguments oauthArgs =
        new OAuthArguments(AuthType.OAUTH, ImmutableMap.<String, String>of());
    oauthArgs.setSignOwner(false);
    oauthArgs.setServiceName("oauthService");
    httpRequest.setOAuthArguments(oauthArgs);
    httpRequest.setPostBody("POSTBODY".getBytes());
   
    Capture<HttpRequest> requestCapture = new Capture<HttpRequest>();
    expect(pipeline.execute(capture(requestCapture))).andReturn(builder.create());
View Full Code Here


    SecurityToken securityToken = new BasicSecurityToken(ownerId, "", "", "",
        APP_URI.toString(), MODULE_ID, CONTAINER_NAME, null, null);

    HttpRequest request = new HttpRequest(DEFAULT_URI)
        .setAuthType(AuthType.SIGNED)
        .setOAuthArguments(new OAuthArguments(authInfo))
        .setSecurityToken(securityToken);

    CacheKeyBuilder key = new CacheKeyBuilder()
        .setLegacyParam(0, DEFAULT_URI)
        .setLegacyParam(1, AuthType.SIGNED)
View Full Code Here

    SecurityToken securityToken = new BasicSecurityToken(
        "", viewerId, "", "", APP_URI.toString(), MODULE_ID, CONTAINER_NAME, null, null);

    HttpRequest request = new HttpRequest(DEFAULT_URI)
        .setAuthType(AuthType.SIGNED)
        .setOAuthArguments(new OAuthArguments(authInfo))
        .setSecurityToken(securityToken);

    CacheKeyBuilder key = new CacheKeyBuilder()
        .setLegacyParam(0, DEFAULT_URI)
        .setLegacyParam(1, AuthType.SIGNED)
View Full Code Here

    SecurityToken securityToken = new BasicSecurityToken(
        userId, userId, "", "", APP_URI.toString(), MODULE_ID, CONTAINER_NAME, null, null);

    HttpRequest request = new HttpRequest(DEFAULT_URI)
        .setAuthType(AuthType.SIGNED)
        .setOAuthArguments(new OAuthArguments(authInfo))
        .setSecurityToken(securityToken);

    CacheKeyBuilder key = new CacheKeyBuilder()
        .setLegacyParam(0, DEFAULT_URI)
        .setLegacyParam(1, AuthType.SIGNED)
View Full Code Here

        false /* isSignViewer */,
        ImmutableMap.<String, String>of());
    replay(authInfo);
    HttpRequest request = new HttpRequest(DEFAULT_URI)
        .setAuthType(AuthType.SIGNED)
        .setOAuthArguments(new OAuthArguments(authInfo));
    cache.createKey(request);
  }
View Full Code Here

    if (auth != AuthType.NONE) {
      req.setSecurityToken(extractAndValidateToken(request));
      if (auth == AuthType.OAUTH2) {
        req.setOAuth2Arguments(new OAuth2Arguments(request));
      } else {
        req.setOAuthArguments(new OAuthArguments(auth, request));
      }
    } else {
      // if not authenticated, set the token that we received
      req.setSecurityToken(token);
    }
View Full Code Here

          OAuth2Arguments oauth2Args = new OAuth2Arguments(req.getAuthType(), authSettings);

          req.setOAuth2Arguments(oauth2Args);
        } else {
          Map<String, String> authSettings = getAuthSettings(requestItem);
          OAuthArguments oauthArgs = new OAuthArguments(req.getAuthType(), authSettings);
          oauthArgs.setSignOwner(httpApiRequest.signOwner);
          oauthArgs.setSignViewer(httpApiRequest.signViewer);

          req.setOAuthArguments(oauthArgs);
        }
      }
View Full Code Here

        uri.addQueryParameter("lang", context.getLocale().getLanguage());
        uri.addQueryParameter("country", context.getLocale().getCountry());

        HttpRequest request = new HttpRequest(uri.toUri())
            .setIgnoreCache(context.getIgnoreCache())
            .setOAuthArguments(new OAuthArguments(view))
            .setAuthType(view.getAuthType())
            .setSecurityToken(context.getToken())
            .setContainer(context.getContainer())
            .setGadget(spec.getUrl());
        HttpResponse response = fetcher.fetch(request);
View Full Code Here

  /**
   * Create arguments simulating authz=OAUTH.
   */
  public OAuthArguments makeNonSocialOAuthArguments() {
    OAuthArguments params = new OAuthArguments();
    params.setUseToken(UseToken.ALWAYS);
    params.setServiceName(serviceName);
    params.setSignOwner(false);
    params.setSignViewer(false);
    return params;
  }
View Full Code Here

 
  /**
   * Create arguments simulating authz=SIGNED.
   */
  public OAuthArguments makeSignedFetchArguments() {
    OAuthArguments params = new OAuthArguments();
    params.setUseToken(UseToken.NEVER);
    params.setSignOwner(true);
    params.setSignViewer(true);
    return params;
  }
View Full Code Here

TOP

Related Classes of org.apache.shindig.gadgets.oauth.OAuthArguments

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.