use of com.google.cloud.iam.credentials.v1.IamCredentialsClient in project gapic-generator-java by googleapis.
the class SyncSignJwtServiceaccountnameListstringString method syncSignJwtServiceaccountnameListstringString.
public static void syncSignJwtServiceaccountnameListstringString() throws Exception {
// It may require modifications to work in your environment.
try (IamCredentialsClient iamCredentialsClient = IamCredentialsClient.create()) {
ServiceAccountName name = ServiceAccountName.of("[PROJECT]", "[SERVICE_ACCOUNT]");
List<String> delegates = new ArrayList<>();
String payload = "payload-786701938";
SignJwtResponse response = iamCredentialsClient.signJwt(name, delegates, payload);
}
}
use of com.google.cloud.iam.credentials.v1.IamCredentialsClient in project gapic-generator-java by googleapis.
the class SyncGenerateIdToken method syncGenerateIdToken.
public static void syncGenerateIdToken() throws Exception {
// It may require modifications to work in your environment.
try (IamCredentialsClient iamCredentialsClient = IamCredentialsClient.create()) {
GenerateIdTokenRequest request = GenerateIdTokenRequest.newBuilder().setName(ServiceAccountName.of("[PROJECT]", "[SERVICE_ACCOUNT]").toString()).addAllDelegates(new ArrayList<String>()).setAudience("audience975628804").setIncludeEmail(true).build();
GenerateIdTokenResponse response = iamCredentialsClient.generateIdToken(request);
}
}
use of com.google.cloud.iam.credentials.v1.IamCredentialsClient in project gapic-generator-java by googleapis.
the class SyncGenerateIdTokenServiceaccountnameListstringStringBoolean method syncGenerateIdTokenServiceaccountnameListstringStringBoolean.
public static void syncGenerateIdTokenServiceaccountnameListstringStringBoolean() throws Exception {
// It may require modifications to work in your environment.
try (IamCredentialsClient iamCredentialsClient = IamCredentialsClient.create()) {
ServiceAccountName name = ServiceAccountName.of("[PROJECT]", "[SERVICE_ACCOUNT]");
List<String> delegates = new ArrayList<>();
String audience = "audience975628804";
boolean includeEmail = true;
GenerateIdTokenResponse response = iamCredentialsClient.generateIdToken(name, delegates, audience, includeEmail);
}
}
use of com.google.cloud.iam.credentials.v1.IamCredentialsClient in project gapic-generator-java by googleapis.
the class AsyncSignBlob method asyncSignBlob.
public static void asyncSignBlob() throws Exception {
// It may require modifications to work in your environment.
try (IamCredentialsClient iamCredentialsClient = IamCredentialsClient.create()) {
SignBlobRequest request = SignBlobRequest.newBuilder().setName(ServiceAccountName.of("[PROJECT]", "[SERVICE_ACCOUNT]").toString()).addAllDelegates(new ArrayList<String>()).setPayload(ByteString.EMPTY).build();
ApiFuture<SignBlobResponse> future = iamCredentialsClient.signBlobCallable().futureCall(request);
// Do something.
SignBlobResponse response = future.get();
}
}
use of com.google.cloud.iam.credentials.v1.IamCredentialsClient in project gapic-generator-java by googleapis.
the class SyncSignBlobServiceaccountnameListstringBytestring method syncSignBlobServiceaccountnameListstringBytestring.
public static void syncSignBlobServiceaccountnameListstringBytestring() throws Exception {
// It may require modifications to work in your environment.
try (IamCredentialsClient iamCredentialsClient = IamCredentialsClient.create()) {
ServiceAccountName name = ServiceAccountName.of("[PROJECT]", "[SERVICE_ACCOUNT]");
List<String> delegates = new ArrayList<>();
ByteString payload = ByteString.EMPTY;
SignBlobResponse response = iamCredentialsClient.signBlob(name, delegates, payload);
}
}
Aggregations