Skip to content

Kerberos gives 401 - "authentication required" #370

Answered by rajanadar
AlexanderRydberg asked this question in Q&A
Discussion options

You must be logged in to vote

hi @AlexanderRydberg , couple of things.

  • The default credentials used by KerberosAuthMethodInfo is not DefaultNetworkCredentials, it is DefaultCredentials.
  • Also, VaultSharp sets the Kerberos creds in its HttpHandler initialization. Because you're providing your own HttpHandler for ssl success, you also need to set the kerberos part.

KerberosAuthMethodInfo authMethod = new KerberosAuthMethodInfo();  // uses DEFAULT credential by default.
var vaultClientSettings = new VaultClientSettings("https://vault.example.com:8200", authMethod);

var httpHandler = new HttpClientHandler
{
    ServerCertificateCustomValidationCallback = (message, cert, chain, errors) => true
};

httpHandler.PreAuthent…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@AlexanderRydberg
Comment options

Answer selected by AlexanderRydberg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants