com.google.api.services.youtube.YouTubeScopes Java Examples
The following examples show how to use
com.google.api.services.youtube.YouTubeScopes.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Main.java From youtube-chat-for-minecraft with Apache License 2.0 | 6 votes |
public static void main(String[] args) throws IOException { if (args.length == 0) { showUsage(); return; } switch (args[0]) { case "login": System.out.print("Paste the client ID JSON from the Google API console:"); BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String clientSecret = br.readLine(); List<String> scopes = new ArrayList<String>(); scopes.add(YouTubeScopes.YOUTUBE_FORCE_SSL); scopes.add(YouTubeScopes.YOUTUBE); Auth.authorize(scopes, clientSecret, YouTubeChat.MODID); break; case "logout": Auth.clearCredentials(); break; default: showUsage(); } }
Example #2
Source File: Auth.java From UTubeTV with The Unlicense | 6 votes |
public static GoogleAccountCredential getCredentials(Context ctx, boolean useDefaultAccount) { if (credential == null) { List<String> scopes = Arrays.asList(YouTubeScopes.YOUTUBE); credential = GoogleAccountCredential.usingOAuth2(ctx.getApplicationContext(), scopes); // add account name if we have it String accountName = null; if (useDefaultAccount) accountName = accountName(ctx); if (accountName != null) credential.setSelectedAccountName(accountName); } return credential; }