Scram Sha Client Authentication Example

This example provide a simple java based ScramSha256 HTTP client for authenticating with a Niagara AX 3.8 station. HTTP digest requires that the server store passwords in a reversible form. This goes against security best practices for storing credentials and is not supported by the standard Niagara station digest authentication scheme.

The ScramSha256Client provided is a condensed form and is missing a few optimization that the may prove to be beneficial.

In the AuthClientExample class is a reference to an inner class called the TrustModifier class. This class is for demonstration purposes only and SHOULD NOT be used in production under any circumstance. It may be tempting to say “It’s not that big of a deal!” That would be completely incorrect and use of the class completely invalidates the use of TLS since identity can no longer be trusted (non-repudiation).

The main argument for the example is of the form http[s]://<username>:<password>@<host>[:<port>]. If the username or password uses any reserved html characters, make sure they are url encoded.

References

Sample Code