Examples of newAuthorizationUrl()


Examples of com.google.api.client.googleapis.auth.oauth2.GoogleAuthorizationCodeFlow.newAuthorizationUrl()

      credential = new GoogleCredential.Builder().setTransport(new NetHttpTransport()).setJsonFactory(new GsonFactory())
          .setClientSecrets(googleDriveOptions.getClientID(), googleDriveOptions.getClientSecret()).build();

      if (StringUtils.isEmpty(clientTokenAsJson)) {

        final String url = flow.newAuthorizationUrl().setRedirectUri(REDIRECT_URL).build();
        System.out.println("Please open the following URL in your browser, copy the authorization code and enter below.");
        System.out.println("\n" + url + "\n");
        final String code = new BufferedReader(new InputStreamReader(System.in)).readLine().trim();

        clientToken = flow.newTokenRequest(code).setRedirectUri(REDIRECT_URL).execute();
View Full Code Here

Examples of com.google.api.client.googleapis.auth.oauth2.GoogleAuthorizationCodeFlow.newAuthorizationUrl()

        // can, but this can be turned off by setting
        // api.dfa.refreshOAuth2Token=false in your ads.properties file.
        .setAccessType("offline").build();

    String authorizeUrl =
        authorizationFlow.newAuthorizationUrl().setRedirectUri(CALLBACK_URL).build();
    System.out.println("Paste this url in your browser: \n" + authorizeUrl + '\n');

    // Wait for the authorization code.
    System.out.println("Type the code you received here: ");
    String authorizationCode = new BufferedReader(new InputStreamReader(System.in)).readLine();
View Full Code Here

Examples of com.google.api.client.googleapis.auth.oauth2.GoogleAuthorizationCodeFlow.newAuthorizationUrl()

        // can, but this can be turned off by setting
        // api.dfa.refreshOAuth2Token=false in your ads.properties file.
        .setAccessType("offline").build();

    String authorizeUrl =
        authorizationFlow.newAuthorizationUrl().setRedirectUri(CALLBACK_URL).build();
    System.out.println("Paste this url in your browser: \n" + authorizeUrl + '\n');

    // Wait for the authorization code.
    System.out.println("Type the code you received here: ");
    String authorizationCode = new BufferedReader(new InputStreamReader(System.in)).readLine();
View Full Code Here

Examples of com.google.api.client.googleapis.auth.oauth2.GoogleAuthorizationCodeFlow.newAuthorizationUrl()

        // can, but this can be turned off by setting
        // api.adwords.refreshOAuth2Token=false in your ads.properties file.
        .setAccessType("offline").build();

    String authorizeUrl =
        authorizationFlow.newAuthorizationUrl().setRedirectUri(CALLBACK_URL).build();
    System.out.println("Paste this url in your browser: \n" + authorizeUrl + '\n');

    // Wait for the authorization code.
    System.out.println("Type the code you received here: ");
    String authorizationCode = new BufferedReader(new InputStreamReader(System.in)).readLine();
View Full Code Here

Examples of com.google.api.client.googleapis.auth.oauth2.GoogleAuthorizationCodeFlow.newAuthorizationUrl()

        // can, but this can be turned off by setting
        // api.adwords.refreshOAuth2Token=false in your ads.properties file.
        .setAccessType("offline").build();

    String authorizeUrl =
        authorizationFlow.newAuthorizationUrl().setRedirectUri(CALLBACK_URL).build();
    System.out.println("Paste this url in your browser: \n" + authorizeUrl + '\n');

    // Wait for the authorization code.
    System.out.println("Type the code you received here: ");
    String authorizationCode = new BufferedReader(new InputStreamReader(System.in)).readLine();
View Full Code Here

Examples of com.google.api.client.googleapis.auth.oauth2.GoogleAuthorizationCodeFlow.newAuthorizationUrl()

        // can, but this can be turned off by setting
        // api.dfp.refreshOAuth2Token=false in your ads.properties file.
        .setAccessType("offline").build();

    String authorizeUrl =
        authorizationFlow.newAuthorizationUrl().setRedirectUri(CALLBACK_URL).build();
    System.out.println("Paste this url in your browser: \n" + authorizeUrl + '\n');

    // Wait for the authorization code.
    System.out.println("Type the code you received here: ");
    String authorizationCode = new BufferedReader(new InputStreamReader(System.in)).readLine();
View Full Code Here

Examples of com.google.api.client.googleapis.auth.oauth2.GoogleAuthorizationCodeFlow.newAuthorizationUrl()

        // can, but this can be turned off by setting
        // api.dfp.refreshOAuth2Token=false in your ads.properties file.
        .setAccessType("offline").build();

    String authorizeUrl =
        authorizationFlow.newAuthorizationUrl().setRedirectUri(CALLBACK_URL).build();
    System.out.println("Paste this url in your browser: \n" + authorizeUrl + '\n');

    // Wait for the authorization code.
    System.out.println("Type the code you received here: ");
    String authorizationCode = new BufferedReader(new InputStreamReader(System.in)).readLine();
View Full Code Here

Examples of com.google.api.client.googleapis.auth.oauth2.GoogleAuthorizationCodeFlow.newAuthorizationUrl()

  JsonFactory jsonFactory = new JacksonFactory();      
  GoogleAuthorizationCodeFlow flow = new GoogleAuthorizationCodeFlow.Builder(       
      httpTransport, jsonFactory, CLIENT_ID, CLIENT_SECRET, Arrays.asList(DriveScopes.DRIVE))       
  .setAccessType("online")       
  .setApprovalPrompt("auto").build();       
  String url = flow.newAuthorizationUrl().setRedirectUri(REDIRECT_URI).build();   
  System.out.println("Please open the following URL in your browser then type the authorization code:");   
  System.out.println("  " + url);   
  BufferedReader br = new BufferedReader(new InputStreamReader(System.in));   
  String code = br.readLine();       
  GoogleTokenResponse response = flow.newTokenRequest(code).setRedirectUri(REDIRECT_URI).execute();   
View Full Code Here

Examples of com.google.api.client.googleapis.auth.oauth2.GoogleAuthorizationCodeFlow.newAuthorizationUrl()

        // can, but this can be turned off by setting
        // api.adwords.refreshOAuth2Token=false in your ads.properties file.
        .setAccessType("offline").build();

    String authorizeUrl =
        authorizationFlow.newAuthorizationUrl().setRedirectUri(CALLBACK_URL).build();
    System.out.println("Paste this url in your browser: \n" + authorizeUrl + '\n');

    // Wait for the authorization code.
    System.out.println("Type the code you received here: ");
    String authorizationCode = new BufferedReader(new InputStreamReader(System.in)).readLine();
View Full Code Here

Examples of com.google.api.client.googleapis.auth.oauth2.GoogleAuthorizationCodeFlow.newAuthorizationUrl()

        // can, but this can be turned off by setting
        // api.adwords.refreshOAuth2Token=false in your ads.properties file.
        .setAccessType("offline").build();

    String authorizeUrl =
        authorizationFlow.newAuthorizationUrl().setRedirectUri(CALLBACK_URL).build();
    System.out.println("Paste this url in your browser: \n" + authorizeUrl + '\n');

    // Wait for the authorization code.
    System.out.println("Type the code you received here: ");
    String authorizationCode = new BufferedReader(new InputStreamReader(System.in)).readLine();
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.