Package com.google.api.client.json.jackson2

Examples of com.google.api.client.json.jackson2.JacksonFactory


   *             error creating the credentials
   */
  private Credential buildOAuth2Credentials(String authToken) {

    Credential credential = new GoogleCredential.Builder().setClientSecrets(clientId, clientSecret)
        .setJsonFactory(new JacksonFactory()).setTransport(new NetHttpTransport()).build()
        .setRefreshToken(authToken);

    return credential;
  }
View Full Code Here


      tokenRequest.setRedirectUri(CALLBACK_URL);
      GoogleTokenResponse tokenResponse = tokenRequest.execute();

      //  Create the credential.
      Credential credential = new GoogleCredential.Builder().setClientSecrets(clientId, clientSecret)
          .setJsonFactory(new JacksonFactory()).setTransport(new NetHttpTransport()).build().setFromTokenResponse(tokenResponse);

      // Set authorized credentials.
      credential.setFromTokenResponse(tokenResponse);

      return credential;
View Full Code Here

    }
  }

  private GoogleAuthorizationCodeFlow getAuthorizationFlow() {
    GoogleAuthorizationCodeFlow authorizationFlow = new GoogleAuthorizationCodeFlow.Builder(
        new NetHttpTransport(), new JacksonFactory(), clientId, clientSecret,
        Arrays.asList(scope.split("\\s*,\\s*")))
    .setAccessType("offline").setApprovalPrompt("force").build();

    return authorizationFlow;
  }
View Full Code Here

  /**
   * Constructs the GoogleDriveService for the Authenticator
   * It stores GoogleDriveService in a hash for re-usability.
   */
  private GoogleDriveService(Credential credential) throws OAuthException {
    this.service =  new Drive.Builder(new NetHttpTransport(), new JacksonFactory(),
        credential).setApplicationName(DRIVE_APP_NAME).build();   
    googleDriveServiceHash.put(credential, this);
  }
View Full Code Here

          if(responseJSON.has("error")) {
            throw new IllegalStateException();
          }
         
          String idToken = responseJSON.getString("id_token");
          GoogleIdToken userIdToken = GoogleIdToken.parse(new JacksonFactory(), idToken);
          GoogleIdToken.Payload googlePayload = userIdToken.getPayload();
          String userId = googlePayload.getSubject();
         
          if(googlePayload.getIssuer().equals("accounts.google.com")
          && googlePayload.getAudience().equals(this.clientId)) {
View Full Code Here

  @Provides
  @Singleton
  Bigquery provideBigquery() {
    return new Bigquery.Builder(
        new UrlFetchTransport(),
        new JacksonFactory(),
        new AppIdentityCredential(BigqueryScopes.all()))
            .setApplicationName(BigQueryModule.class.getName())
            .build();
  }
View Full Code Here

TOP

Related Classes of com.google.api.client.json.jackson2.JacksonFactory

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.