An example that demonstrates a basic Auth Callout handler. Run the main from the AuthCalloutServiceExample class.
-
You must start the NATS server using the auth-callout-no-encrypt.conf configuration file found in this directory. For example:
nats-server -c /<nats-stuff>/java-nats-examples/auth-callout/auth-callout-no-encrypt.conf
-
The Java NKeys and JWT libraries do not yet support encrypted auth callout.
-
The example depends on the jwt.java library. That library has been extracted from the JNATS client and reorganized to avoid clashing with the original, which has been left in the client. It started out identical but was improved and expanded to support Auth Callout.
-
The jwt.java library depends on two other libraries that have been extracted from the JNATS client. They both also have been reorganized to avoid clashing with the original, but otherwise are essentially the same. The libraries are json.java and nkeys.java The dependency tree looks like this:
+--- io.nats:jwt-java:2.0.0 +--- io.nats:nkeys-java:2.0.1 \--- io.nats:jnats-json:2.0.0
Unless otherwise noted, the NATS source files are distributed under the Apache Version 2.0 license found in the LICENSE file.