You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Using KerberosAuthMethodHelper.GetServicePrincipalNegotiationTokenAsync duplicates the domain name.
VaultSharp Version 1.17.5.1
Vault Version Vault v1.18.0 (77f26ba561a4b6b1ccd5071b8624cefef7a72e84), built 2024-10-08T09:12:52Z
Does this work with Vault CLI?
Yes
Sample Code Snippet
Output from Vault CLI
PS C:\Programs\vault> .\vault login -method=kerberos username=ion.mincu service=HTTP/im-ws2019-01 realm=DESKOVER.LOCAL keytab_path=ion.mincu.keytab krb5conf_path=krb5.conf disable_fast_negotiation=true
Success! You are now authenticated. The token information displayed below
is already stored in the token helper. You do NOT need to run "vault login"
again. Future Vault requests will automatically use this token.
Key Value
--- -----
token hvs.CAESIE289Dkbm3LysjR8NKVPP-BKKUt94wKzaQqBDesF-pVsGh4KHGh2cy5XbzBMR3NTVGhOaUtDblJOT3BJRlQ3WG4
token_accessor IKnwddD0Acz6JrLteuCdM9Un
token_duration 768h
token_renewable false
token_policies ["default"]
identity_policies []
policies ["default"]
token_meta_domain DESKOVER.LOCAL
token_meta_user ion.mincu
PS C:\Programs\vault> .\vault -v
Vault v1.18.0 (77f26ba561a4b6b1ccd5071b8624cefef7a72e84), built 2024-10-08T09:12:52Z
Using the exact same keytab
publicasyncstatic Task PostRequest(){vartoken=await KerberosAuthMethodHelper.GetServicePrincipalNegotiationTokenAsync("ion.mincu","HTTP/im-ws2019-01","DESKOVER.LOCAL", _keyTabPath, _krb5conf,true, factory);varhandler=new HttpClientHandler(){// Proxy = new WebProxy { BypassProxyOnLocal = true },PreAuthenticate=true,UseDefaultCredentials=true,AllowAutoRedirect=true,// Credentials = CredentialCache.DefaultNetworkCredentials};using(varclient=new HttpClient(handler)){
client.BaseAddress =new Uri("http://im-ws2019-01.deskover.local:8200/");
client.DefaultRequestHeaders.Add("Authorization", token);varcontent=new StringContent("null");varresponse=await client.PostAsync("v1/auth/kerberos/login", content);// If the request is successful, read the response body as stringif(response.IsSuccessStatusCode){varresponseBody=await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);}else{
Console.WriteLine($"Error when posting manually: {response.StatusCode}");}}}
Exception Details/Stack Trace/Error Message
Error message, stack trace you see
Any additional info
Vault logs when logging in with CLI
Describe the bug
Using
KerberosAuthMethodHelper.GetServicePrincipalNegotiationTokenAsync
duplicates the domain name.VaultSharp Version
1.17.5.1
Vault Version
Vault v1.18.0 (77f26ba561a4b6b1ccd5071b8624cefef7a72e84), built 2024-10-08T09:12:52Z
Does this work with Vault CLI?
Yes
Sample Code Snippet
Output from Vault CLI
Using the exact same keytab
Exception Details/Stack Trace/Error Message
Error message, stack trace you see
Any additional info
Vault logs when logging in with CLI
Vault logs when logging in with C# code notice the principal is
[email protected]@DESKOVER.LOCAL
The text was updated successfully, but these errors were encountered: