Open sjvanrossum opened 2 months ago
ComputeEngineCredentials
IdTokenCredentials
#setOptions()
IdTokenProvider.Option.LICENSES_TRUE
IdTokenProvider.Option.FORMAT_FULL
new String(Base64.getUrlDecoder() .decode(IdTokenCredentials.newBuilder() .setIdTokenProvider(ComputeEngineCredentials.create()) .setTargetAudience("https://foo.bar") .setOptions(Arrays.asList( IdTokenProvider.Option.FORMAT_FULL, IdTokenProvider.Option.LICENSES_TRUE)) .build() .refreshAccessToken() .getTokenValue() .split("\\.")[1]), StandardCharsets.UTF_8)
Steps to reproduce
ComputeEngineCredentials
on a GCE VM.IdTokenCredentials
from the above with#setOptions()
containingIdTokenProvider.Option.LICENSES_TRUE
and optionally the impliedIdTokenProvider.Option.FORMAT_FULL
.Code example