use of com.google.api.client.googleapis.auth.oauth2.GoogleClientSecrets.Details in project muikku by otavanopisto.
the class GoogleCalendarClient method getAccessTokenCredential.
@SuppressWarnings("unused")
private GoogleCredential getAccessTokenCredential() {
AccessToken googleAccessToken = sessionController.getOAuthAccessToken("google");
if (googleAccessToken != null) {
Details details = new Details();
details.setClientId("-");
details.setClientSecret("-");
GoogleClientSecrets secrets = new GoogleClientSecrets();
secrets.setWeb(details);
return new GoogleCredential.Builder().setClientSecrets(secrets).setTransport(TRANSPORT).setJsonFactory(JSON_FACTORY).build().setAccessToken(googleAccessToken.getToken());
}
return null;
}
use of com.google.api.client.googleapis.auth.oauth2.GoogleClientSecrets.Details in project google-api-java-client by google.
the class GoogleClientSecretsTest method testLoad.
public void testLoad() throws Exception {
GoogleClientSecrets clientSecrets = GoogleClientSecrets.load(new GsonFactory(), new StringReader(CLIENT_SECRETS));
Details installed = clientSecrets.getInstalled();
assertNotNull(installed);
assertEquals(CLIENT_ID, installed.getClientId());
assertEquals(CLIENT_SECRET, installed.getClientSecret());
}
Aggregations