Skip to content

Instantly share code, notes, and snippets.

@ryanvgates
Created October 30, 2018 04:27
Show Gist options
  • Save ryanvgates/ee5c7a83f5140081112e82e60fccc9eb to your computer and use it in GitHub Desktop.
Save ryanvgates/ee5c7a83f5140081112e82e60fccc9eb to your computer and use it in GitHub Desktop.
HashiCorp Vault Consumer Authenticate
dynamic user = new ExpandoObject();
user.user_id = userId;
var content = new StringContent(JsonConvert.SerializeObject(user), Encoding.UTF8, "application/json");
var cleanedappId = HttpUtility.UrlEncode(appId);
var response = client.PostAsync(url + $"auth/app-id/login/{cleanedappId}", content).Result;
var body = response.Content.ReadAsStringAsync().Result;
var serializedBody = JsonConvert.DeserializeObject<IDictionary<string, dynamic>>(body);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment