Examples of OAuth2Arguments


Examples of org.apache.shindig.gadgets.oauth2.OAuth2Arguments

    setupGadgetAdminMock(true);
    Map<String, String> options = new HashMap<String, String>();
    options.put("OAUTH_SERVICE_NAME", "example");
    options.put("OAUTH_SCOPE", "scope1 scope2");
    request.setAuthType(AuthType.OAUTH2);
    request.setOAuth2Arguments(new OAuth2Arguments(AuthType.OAUTH2, options));

    options = new HashMap<String, String>();
    options.put("OAUTH_SERVICE_NAME", "example");
    options.put("OAUTH_SCOPE", "scope1 scope2");
    HttpRequest req = new HttpRequest(Uri.parse(url))
        .setAuthType(AuthType.OAUTH2)
        .setGadget(Uri.parse(""))
        .setContainer("default")
        .setOAuth2Arguments(new OAuth2Arguments(AuthType.OAUTH2, options));

    HttpResponse resp = new HttpResponseBuilder()
    .setResponseString("Hello")
    .create();
    expect(pipeline.execute(req)).andReturn(resp);
View Full Code Here

Examples of org.apache.shindig.gadgets.oauth2.OAuth2Arguments

    expect(request.getParameterNames()).andReturn(Collections.enumeration(options.keySet()));
    expect(lockedDomainService.isSafeForOpenProxy(uri.getAuthority())).andReturn(true);

    ProxyUriManager.ProxyUri pUri = new ProxyUri(-1, false, true, "default", "http://example.org/gadget.xml", REQUEST_URL);
    pUri.setAuthType(AuthType.OAUTH2);
    pUri.setOAuth2Arguments(new OAuth2Arguments(AuthType.OAUTH2, options));

    expect(proxyHandler.fetch(pUri)).andReturn(new HttpResponse(RESPONSE_BODY));
    replay();
    servlet.doGet(request, recorder);
    verify();
View Full Code Here

Examples of org.apache.shindig.gadgets.oauth2.OAuth2Arguments

    AuthType auth = AuthType.parse(getParameter(request, AUTHZ_PARAM, null));
    req.setAuthType(auth);
    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
View Full Code Here

Examples of org.apache.shindig.gadgets.oauth2.OAuth2Arguments

      }
      AuthType authType = proxyUri.getAuthType();
      if(AuthType.OAUTH.equals(authType)) {
        proxyUri.setOAuthArguments(new OAuthArguments(AuthType.OAUTH, request));
      } else if(AuthType.OAUTH2.equals(authType)) {
        proxyUri.setOAuth2Arguments(new OAuth2Arguments(request));
      }

      // TODO: Consider removing due to redundant logic.
      String host = request.getHeader("Host");
      if (!lockedDomainService.isSafeForOpenProxy(host)) {
View Full Code Here

Examples of org.apache.shindig.gadgets.oauth2.OAuth2Arguments

      final AuthType authType = req.getAuthType();
      if (authType != AuthType.NONE) {
        if (authType == AuthType.OAUTH2) {
          Map<String, String> authSettings = getAuthSettings(requestItem);
          OAuth2Arguments oauth2Args = new OAuth2Arguments(req.getAuthType(), authSettings);

          req.setOAuth2Arguments(oauth2Args);
        } else {
          Map<String, String> authSettings = getAuthSettings(requestItem);
          OAuthArguments oauthArgs = new OAuthArguments(req.getAuthType(), authSettings);
View Full Code Here

Examples of org.apache.shindig.gadgets.oauth2.OAuth2Arguments

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

Examples of org.apache.shindig.gadgets.oauth2.OAuth2Arguments

    securityToken = request.securityToken;
    if (request.oauthArguments != null) {
      oauthArguments = new OAuthArguments(request.oauthArguments);
    }
    if (request.oauth2Arguments != null) {
      oauth2Arguments = new OAuth2Arguments(request.oauth2Arguments);
    }
    authType = request.authType;
    rewriteMimeType = request.rewriteMimeType;
    followRedirects = request.followRedirects;
    internalRequest = request.internalRequest;
View Full Code Here

Examples of org.apache.shindig.gadgets.oauth2.OAuth2Arguments

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

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

    HttpRequest request = new HttpRequest(uri.toUri())
        .setIgnoreCache(context.getIgnoreCache())
        .setOAuthArguments(oauthArgs)
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.