Package org.apache.shindig.gadgets.oauth

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


    cacheTtl = request.cacheTtl;
    gadget = request.gadget;
    container = request.container;
    securityToken = request.securityToken;
    if (request.oauthArguments != null) {
      oauthArguments = new OAuthArguments(request.oauthArguments);
    }
    if (request.oauth2Arguments != null) {
      oauth2Arguments = new OAuth2Arguments(request.oauth2Arguments);
    }
    authType = request.authType;
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

  /**
   * Track state (see gadgets.io.makeRequest handling of the oauthState and received callback
   * parameters.
   */
  private OAuthArguments recallState() {
    OAuthArguments params = new OAuthArguments(baseArgs);
    params.setOrigClientState(oauthState);
    params.setReceivedCallbackUrl(receivedCallbackUrl);
    receivedCallbackUrl = null;
    return params;
  }
View Full Code Here

    // Figure out whether authentication is required
    AuthType auth = AuthType.parse(getParameter(request, AUTHZ_PARAM, null));
    req.setAuthType(auth);
    if (auth != AuthType.NONE) {
      req.setSecurityToken(extractAndValidateToken(request));
      req.setOAuthArguments(new OAuthArguments(auth, request));
    }
    return req;
  }
View Full Code Here

  // TODO: move somewhere more sensible
  public static HttpRequest newHttpRequest(GadgetContext context,
      RequestAuthenticationInfo authenticationInfo) throws GadgetException {
    return new HttpRequest(authenticationInfo.getHref())
        .setSecurityToken(context.getToken())
        .setOAuthArguments(new OAuthArguments(authenticationInfo))
        .setAuthType(authenticationInfo.getAuthType())
        .setContainer(context.getContainer())
        .setGadget(context.getUrl())
        .setIgnoreCache(context.getIgnoreCache());
  }
View Full Code Here

    cacheTtl = request.cacheTtl;
    gadget = request.gadget;
    container = request.container;
    securityToken = request.securityToken;
    if (request.oauthArguments != null) {
      oauthArguments = new OAuthArguments(request.oauthArguments);
    }
    authType = request.authType;
    rewriteMimeType = request.rewriteMimeType;
    followRedirects = request.followRedirects;
  }
View Full Code Here

      if (req.getAuthType() != AuthType.NONE) {
        req.setSecurityToken(requestItem.getToken());
       
        Map<String, String> authSettings = getAuthSettings(requestItem);
        OAuthArguments oauthArgs = new OAuthArguments(req.getAuthType(), authSettings);
        oauthArgs.setSignOwner(httpApiRequest.signOwner);
        oauthArgs.setSignViewer(httpApiRequest.signViewer);
       
        req.setOAuthArguments(oauthArgs);
      }

      // TODO: Allow the rewriter to use an externally forced mime type. This is needed
View Full Code Here

    UriBuilder uri = new UriBuilder(href);
    uri.addQueryParameter("lang", context.getLocale().getLanguage());
    uri.addQueryParameter("country", context.getLocale().getCountry());

    OAuthArguments oauthArgs = new OAuthArguments(view);
    oauthArgs.setProxiedContentRequest(true);

    HttpRequest request = new HttpRequest(uri.toUri())
        .setIgnoreCache(context.getIgnoreCache())
        .setOAuthArguments(oauthArgs)
        .setAuthType(view.getAuthType())
View Full Code Here

    SecurityToken securityToken = new BasicSecurityToken(ownerId, "", "", "",
        APP_URI.toString(), MODULE_ID, CONTAINER_NAME, 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

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.