Package org.apache.shindig.gadgets.oauth2.persistence

Examples of org.apache.shindig.gadgets.oauth2.persistence.OAuth2TokenPersistence


    return ret;
  }

  protected OAuth2Token internalCreateToken() {
    return new OAuth2TokenPersistence(this.encrypter);
  }
View Full Code Here


    token.setTokenType(OAuth2Message.BEARER_TOKEN_TYPE);
    token.setUser(MockUtils.USER);
  }

  protected static OAuth2TokenPersistence getAccessToken() throws Exception {
    final OAuth2TokenPersistence accessToken = new OAuth2TokenPersistence(
            MockUtils.getDummyEncrypter());
    MockUtils.setTokenCommons(accessToken);
    accessToken.setType(OAuth2Token.Type.ACCESS);
    return accessToken;
  }
View Full Code Here

    accessToken.setType(OAuth2Token.Type.ACCESS);
    return accessToken;
  }

  protected static OAuth2TokenPersistence getBadMacToken() throws Exception {
    final OAuth2TokenPersistence accessToken = new OAuth2TokenPersistence(
            MockUtils.getDummyEncrypter());
    MockUtils.setTokenCommons(accessToken);
    accessToken.setMacAlgorithm(OAuth2Message.HMAC_SHA_256);
    accessToken.setMacExt("1 2 3");
    accessToken.setMacSecret(MockUtils.MAC_SECRET.getBytes("UTF-8"));
    accessToken.setTokenType(OAuth2Message.MAC_TOKEN_TYPE);
    accessToken.setType(OAuth2Token.Type.ACCESS);
    return accessToken;
  }
View Full Code Here

  protected static String getJSONString() throws IOException {
    return MockUtils.loadFile("org/apache/shindig/gadgets/oauth2/oauth2_test.json");
  }

  protected static OAuth2TokenPersistence getMacToken() throws Exception {
    final OAuth2TokenPersistence accessToken = new OAuth2TokenPersistence(
            MockUtils.getDummyEncrypter());

    MockUtils.setTokenCommons(accessToken);
    accessToken.setMacAlgorithm(OAuth2Message.HMAC_SHA_1);
    accessToken.setMacExt("1 2 3");
    accessToken.setMacSecret(MockUtils.MAC_SECRET.getBytes("UTF-8"));
    accessToken.setTokenType(OAuth2Message.MAC_TOKEN_TYPE);
    accessToken.setType(OAuth2Token.Type.ACCESS);

    return accessToken;
  }
View Full Code Here

    return accessor;
  }

  protected static OAuth2TokenPersistence getRefreshToken() throws Exception {
    final OAuth2TokenPersistence refreshToken = new OAuth2TokenPersistence(
            MockUtils.getDummyEncrypter());
    refreshToken.setExpiresAt(1L);
    refreshToken.setGadgetUri(MockUtils.GADGET_URI1);
    refreshToken.setIssuedAt(0L);
    refreshToken.setMacAlgorithm("");
    refreshToken.setMacExt("");
    refreshToken.setMacSecret(new byte[] {});
    refreshToken.setProperties(MockUtils.EMPTY_MAP);
    refreshToken.setScope(MockUtils.SCOPE);
    refreshToken.setSecret(MockUtils.ACCESS_SECRET.getBytes("UTF-8"));
    refreshToken.setServiceName(MockUtils.SERVICE_NAME);
    refreshToken.setTokenType(OAuth2Message.MAC_TOKEN_TYPE);
    refreshToken.setType(OAuth2Token.Type.REFRESH);
    refreshToken.setUser(MockUtils.USER);
    return refreshToken;
  }
View Full Code Here

    return ret;
  }

  protected OAuth2Token internalCreateToken() {
    return new OAuth2TokenPersistence(this.encrypter);
  }
View Full Code Here

    return ret;
  }

  protected OAuth2Token internalCreateToken() {
    return new OAuth2TokenPersistence(this.encrypter);
  }
View Full Code Here

    this.contextRoot = contextRoot;
    this.configFile = configFile;
  }

  public OAuth2Token createToken() {
    return new OAuth2TokenPersistence(this.encrypter);
  }
View Full Code Here

    return ret;
  }

  protected OAuth2Token internalCreateToken() {
    return new OAuth2TokenPersistence(this.encrypter);
  }
View Full Code Here

    this.contextRoot = contextRoot;
    this.configFile = configFile;
  }

  public OAuth2Token createToken() {
    return new OAuth2TokenPersistence(this.encrypter);
  }
View Full Code Here

TOP

Related Classes of org.apache.shindig.gadgets.oauth2.persistence.OAuth2TokenPersistence

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.