Skip to content

How to connect using username/password. #668

Closed Answered by mtmk
ghostidentity asked this question in Q&A
Discussion options

You must be logged in to vote

you can also pass options for more complicated cases

var opts = new NatsOpts
{
    AuthOpts = new NatsAuthOpts
    {
        Username = "bob",
        Password = "s3cr3t",
    },
};

await using var client = new NatsClient(opts);

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by ghostidentity
Comment options

You must be logged in to vote
0 replies
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