Hi, im trying to login using AWS IAM, but stuck with an exception:
{"errors":["didn't supply required authentication values"]}
code (copied from GitHub's README page):
var amazonSecurityTokenServiceConfig = new AmazonSecurityTokenServiceConfig();
var creds = FallbackCredentialsFactory.GetCredentials();
var iamRequest = GetCallerIdentityRequestMarshaller.Instance.Marshall(new GetCallerIdentityRequest());
iamRequest.Endpoint = new Uri(amazonSecurityTokenServiceConfig.DetermineServiceURL());
iamRequest.ResourcePath = "/";
iamRequest.Headers.Add("User-Agent", "https://github.com/rajanadar/vaultsharp/0.11.1000");
iamRequest.Headers.Add("X-Amz-Security-Token", creds.GetCredentials().Token);
iamRequest.Headers.Add("Content-Type", "application/x-www-form-urlencoded; charset=utf-8");
new AWS4Signer().Sign(iamRequest, amazonSecurityTokenServiceConfig, new RequestMetrics(), creds.GetCredentials().AccessKey,
creds.GetCredentials().SecretKey);
var iamStsRequestHeaders = iamRequest.Headers;
var base64EncodedIamRequestHeaders = Convert.ToBase64String(Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(iamStsRequestHeaders)));
var a1 = new IAMAWSAuthMethodInfo(AuthMethodType.AWS.Type, base64EncodedIamRequestHeaders, Guid.NewGuid().ToString(), "mt-fxrates-honduras");
var cs = new VaultClientSettings(settings.Vault.Host, a1);
var c = new VaultClient(cs);
var secret = c.V1.Secrets.KeyValue.V1.ReadSecretAsync(settings.Vault.Path).Result;
vault's role record
vault write auth/aws/role/mt-fxrates-honduras auth_type=iam policies=mt-fxrates-honduras max_ttl=1h bound_iam_principal_arn=arn:aws:iam::312226949769:role/lambda_basic_vpc_execution
Any help is appreciated. Thanks
Hi there
can you provide a code snippet and the exact exception?
I want to get rid of "appsettings.json" and store application configs in the HashiCorp Vault, it would be nice if this library could "inject" new application configs on the fly without reloading an application.
I imaging it to work like Redis pub/sub, when some data changes, all subscribed parties are notified.
Can this library do this?