Skip to content

Authentication using JWT #731

Answered by mtmk
ghostidentity asked this question in Q&A
Jan 30, 2025 · 4 comments · 4 replies
Discussion options

You must be logged in to vote

@ghostidentity I'm not a Go expert or running embedded server expert but there seems to be an issue loading the config for the server (e.g. make the config invalid or change the port for example, server still runs with defaults.) So the only way I got the config read was by adding this right before server new:

        //
        // ADDED THIS LINE
        //
	err = opts.ProcessConfigFile(configFilePath)

	if err != nil {
		log.Fatalf("Error processing config file: %v", err)
	}

	srv, err := server.NewServer(opts)
	if err != nil {
		log.Fatalf("Error starting NATS server: %v", err)
	}

        //
        // ALSO ADDED THIS LINE FOR LOGGING TO STDOUT
        //
	srv.SetLogger(logger.NewStdL…

Replies: 4 comments 4 replies

Comment options

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

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@mtmk
Comment options

mtmk Feb 10, 2025
Maintainer

@mtmk
Comment options

mtmk Feb 10, 2025
Maintainer

Answer selected by ghostidentity
@ghostidentity
Comment options

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