Class SimpleAuthenticator.Builder

java.lang.Object
io.aeron.security.SimpleAuthenticator.Builder
Enclosing class:
SimpleAuthenticator

public static class SimpleAuthenticator.Builder extends Object
Builder to create instances of SimpleAuthenticator.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • principal

      public SimpleAuthenticator.Builder principal(byte[] encodedPrincipal, byte[] encodedCredentials)
      Add a principal/credentials pair to the list supported by this authenticator. Note that the SimpleAuthenticator keys the principals by the credentials, so the encoded credentials should include the encoded principal. The associated CredentialsSupplier used on the client should handle encoding these credentials correctly as well. For example:
       final SimpleAuthenticator simpleAuthenticator = new SimpleAuthenticator.Builder()
           .principal("user".getBytes(US_ASCII), "user:pass".getBytes(US_ASCII))
           .newInstance();
       
      Parameters:
      encodedPrincipal - principal encoded as a byte array.
      encodedCredentials - credentials encoded as a byte array.
      Returns:
      this for a fluent API.
    • newInstance

      public SimpleAuthenticator newInstance()
      Construct a new instance of the SimpleAuthenticator.
      Returns:
      a new SimpleAuthenticator instance.