I am using the below code for accessing the service account credentials, Not sure Since the secret manager does not accept a credential in their Create(), So I tried the second approach as per https://cloud.google.com/docs/authentication/production#passing_code. What Am I doing wrong?
var text = File.ReadAllText(@"cred.json");
JObject credential = JObject.Parse(text);
SecretManagerServiceClientBuilder secretManagerServiceClientBuilder = new SecretManagerServiceClientBuilder()
{
JsonCredentials = o1,
};
SecretManagerServiceClient client = secretManagerServiceClientBuilder.Build();
// Create the client.
client = SecretManagerServiceClient.Create();