Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
    hi,could you please anyone help to use GitHub using vault.i have a requirement that,write and read some secrets using GitHub have already create personal access token in GitHub and i not able to access GitHub repository from .net.thanks in advance
    Hi there
    I want to establish a connection to Vault system and through the LDAP Auth Method but unable to get authencticated as VaultToken is not getting generated. Can you please help
    Dzmitry Martavoi

    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, 
                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

    David Hoerster
    Hi there! I'm trying to use the VaultSharp Azure Auth method to utilize an MSI that I've created for an App Service that I wan to have communicate with my Vault Server (which is running on a VM). When I go to request a secret from Vault, I get an error that is requiring me to put in the vmName when I create my vault client settings. But since this is an App Service, the resource mapping is off -- the VM name maps to /resources/virtualMachines, but my app service is located at a different resource path. Is support for App Service's using MSI going to be supported in VaultSharp?....and, also, is there a way to authenticate today for an App Service's MSI? Thank you!
    Torben Hørup
    Does anybody know if Raja Nadar is still around - he's been quiet lately ?
    Roman Marusyk
    Hi all, what do you think about this https://github.com/VaultSharp
    Raja Nadar
    @simonthum the relogin is not automatic. you need to do it explicitly.

    Hi there

    can you provide a code snippet and the exact exception?

    ---- folks, there was a personal emergency that kept me out cold. i'm back now. let me know any open issues ---
    Raja Nadar
    Folks, we have some really active community members that have answered questions in the past in GH issues. For the benefit of wider community, the recommendation moving forward is to ask your questions on Stack Overflow, with the vault-sharp tag... Please go ahead and ask questions there. https://stackoverflow.com/questions/tagged/vault-sharp
    Raja Nadar

    hello folks, happy to announce the release of VaultSharp 1.4.0 today. It has all the Auth backends and Secret Engines supported by Vault 1.4.0. Cheers!
    Mohammad Azhar Ali
    @rajanadar I am using VaultSharp NuGet package with .NET frameworks 4.8 and .Net Core 3.1 it's working perfect with .Net Core 3.1 but with .Net Framework 4.8 it's not able to resolve. I am getting this error "Could not load file or assembly VaultSharp, version =, culture =neutral, PublicKeyToken = cb3d4aad92b0eded"
    Raja Nadar
    Thanks Mohammed. Can you please open a github issue? I'll have a look at it this weekend.
    Mohammad Azhar Ali
    Thanks for the response, It worked fine when I copied two dlls in the bin folder newtonsoftjson.dll and vaultsharp.dll
    Raja Nadar
    Glad to hear. Cool
    Hello all, appreciate the library, when making a call to get dynamic auth creds, the call works, can see it being created but the requestid, data is coming back null. any thoughts about how this might be happening?
    Raja Nadar
    Hi Mark, can you please create a github issue with VaultSharp version, vault api version and sample code snippet along with the exception or response you are seeing?
    Hi... Has anyone integrated VaultSharp in dotnet core using kubernetes ServiceAccount Tokens for Vault authentication?
    If so... Any do's and dont's ?
    @Skarinn there is nothing special to do here. Just make sure you have an easy way to track errors in case any issues asrise to help debug configuration and secrets path.
    Raja Nadar
    thanks @copperorange
    When I initialise a new vault via CLI it doesn't give me the base64 key as it does when initialising from the website, anyone know how to generate\retrieve it?
    vault operator init -key-shares=1 -key-threshold=1
    Only the Unseal Key(s) and Initial Root Token are returned.
    Is it possible to init via VaultSharp instead of the CLI?
    Raja Nadar
    Yes. VaultSharp supports most system backend operations as well. You can initialize vault using VaultSharp as follows.
    var masterCredentials = await _unauthenticatedVaultClient.V1.System.InitAsync(initOptions);
    @chinswain let me know if any issues.
    Is it possible to unseal vault via VaultSharp or is it expected that this has been done prior to accessing?
    Also, is there a method to create a new secret engine? I can't see anything in the examples. I'm currently interfacing with the exe directly: .\vault.exe secrets enable -version=1 kv
    Raja Nadar
    @chinswain technically, you can unseal using VaultSharp. This admin operation is supported. However, from a design perspective, end applications normally don't unseal vault. The vault setup, unsealing, mounting backends, writing secrets, creating access control policies etc.
    Are all administrative operations expected to be done ahead of time by the security team or a privileged person.
    As an end application, you use VaultSharp to read secrets.
    However, VaultSharp is built to be used in both end application and admin flows, so it supports a lot of admin operations as well.
    What new secret engine do you want to mount? The kv ones are normally enabled by default. Let me know as a github issue if you need an api support that doesn't exist today

    Mike Lewis
    Hi there - I'm trying to use the CustomAuthMethodInfo class in order to perform a custom auth hook required in our internal org
    However, when I return a CustomAuthMethodInfo from the delegate required in the constructor, I cannot set the ReturnLoginAuthInfo property as it's marked as internal set and not created for me the default constructor
    is this a bug or am I using the class wrong?
    Raja Nadar
    Hi Mike, let me check and get back to you in a day.
    Raja Nadar
    hey Mike, it is a bug. i created a gh issue to track and close within the week. rajanadar/VaultSharp#182
    Please use the TokenAuthInfo method to unblock for now.
    Mike Lewis
    Great, thanks Raja :+1:
    Raja Nadar
    hi @gingermike , i have published a new NuGet of VaultSharp whereby you can set your own AuthInfo. Please let me know if any issues. https://www.nuget.org/packages/VaultSharp/
    Imene Boussour
    Hi, when using curl to connect to Vault we use --proxy "host:port" and -crt "path" for the server certificate (.crt), using vaultSharp I was able to set Proxy settings in PostProcessHttpClientHandlerAction but not sure how to define the server certificate manually? knowing we are using LDAP auth. I want to translate the -crt path command to vb using vaultsharp.
    9 replies
    Artem Avanesov
    Hi everyone

    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?