Я пытаюсь использовать google drive.api Я запустил
private static Credential authorize() throws Exception {
// load client secrets
InputStream in = new FileInputStream("C:\\Users\\orion\\OneDrive\\Documents\\GitHub\\teachervoiceorganization\\JavaProject\\client_id.json");
GoogleClientSecrets clientSecrets = GoogleClientSecrets.load(JSON_FACTORY,
new InputStreamReader(in));
if (clientSecrets.getDetails().getClientId().startsWith("515427348790")
|| clientSecrets.getDetails().getClientSecret().startsWith("i50nkSMoqVegC0UdkD1W8g3Y")) {
System.out.println(
"Enter Client ID and Secret from https://code.google.com/apis/console/?api=drive "
+ "into drive-cmdline-sample/src/main/resources/client_secrets.json");
}
// set up authorization code flow
GoogleAuthorizationCodeFlow flow = new GoogleAuthorizationCodeFlow.Builder(
httpTransport, JSON_FACTORY, clientSecrets,
Collections.singleton(DriveScopes.DRIVE_FILE)).setDataStoreFactory(dataStoreFactory)
.build();
// authorize
return new AuthorizationCodeInstalledApp(flow, new LocalServerReceiver()).authorize("user");
}
У меня проблема с
return new AuthorizationCodeInstalledApp(flow, new LocalServerReceiver()).authorize("user");
Где находится идентификатор пользователя? Я посмотрел на https://console.developers.google.com и не повезло. все поможет.