public void WithUseJwtAccessWithScopes() { var credential = new ServiceAccountCredential(new ServiceAccountCredential.Initializer("MyId").FromPrivateKey(PrivateKey)); Assert.False(credential.UseJwtAccessWithScopes); var credentialWithJwtFlag = credential.WithUseJwtAccessWithScopes(true); Assert.NotSame(credential, credentialWithJwtFlag); Assert.Same(credential.Id, credentialWithJwtFlag.Id); Assert.True(credentialWithJwtFlag.UseJwtAccessWithScopes); }
public static GoogleCredential GetServiceCredentialWithJwtFlag() { ServiceAccountCredential credential = (ServiceAccountCredential)s_serviceCredential.Value.UnderlyingCredential; return(GoogleCredential.FromServiceAccountCredential(credential.WithUseJwtAccessWithScopes(true))); }