com.google.api.services.iam.v1.model.SignJwtRequest Java Examples

The following examples show how to use com.google.api.services.iam.v1.model.SignJwtRequest. 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: ManagedServiceAccountKeyCredential.java    From styx with Apache License 2.0 5 votes vote down vote up
private String signJwt(String serviceAccount, JsonWebToken.Payload payload) throws IOException {
  var fullServiceAccountName = "projects/-/serviceAccounts/" + serviceAccount;
  var request = new SignJwtRequest()
      .setPayload(Utils.getDefaultJsonFactory().toString(payload));
  return iam.projects().serviceAccounts()
      .signJwt(fullServiceAccountName, request)
      .execute()
      .getSignedJwt();
}