Class WsSharedRWTokenAuthenticationHandler

java.lang.Object
com.gmt2001.httpwsserver.auth.WsSharedRWTokenAuthenticationHandler
All Implemented Interfaces:
WsAuthenticationHandler

public class WsSharedRWTokenAuthenticationHandler extends Object implements WsAuthenticationHandler
Provides a WsAuthenticationHandler that implements A Write/ReadOnly token-based authentication where all clients share the same tokens
Author:
gmt2001
  • Field Details

    • ATTR_IS_READ_ONLY

      public static final AttributeKey<Boolean> ATTR_IS_READ_ONLY
      Represents the ATTR_IS_READ_ONLY attribute
    • ATTR_AUTH_USER

      public static final AttributeKey<PanelUser> ATTR_AUTH_USER
      Represents the ATTR_AUTH_USER attribute
  • Constructor Details

    • WsSharedRWTokenAuthenticationHandler

      public WsSharedRWTokenAuthenticationHandler(String readOnlyToken, String readWriteToken, int maxAttempts)
      Constructor
      Parameters:
      readOnlyToken - The authorization token that grants read-only access
      readWriteToken - The authorization token that grants read-write access
      maxAttempts - The maximum allowed auth failure responses before the connection is shut down
    • WsSharedRWTokenAuthenticationHandler

      public WsSharedRWTokenAuthenticationHandler(String readOnlyToken, String readWriteToken, int maxAttempts, boolean allowPaneluser)
      Constructor
      Parameters:
      readOnlyToken - The authorization token that grants read-only access
      readWriteToken - The authorization token that grants read-write access
      maxAttempts - The maximum allowed auth failure responses before the connection is shut down
      allowPaneluser - Whether to allow authenticating via HTTP Headers to a PanelUser
    • WsSharedRWTokenAuthenticationHandler

      public WsSharedRWTokenAuthenticationHandler(String readOnlyToken, String readWriteToken, int maxAttempts, Runnable authenticatedCallback)
      Constructor
      Parameters:
      readOnlyToken - The authorization token that grants read-only access
      readWriteToken - The authorization token that grants read-write access
      maxAttempts - The maximum allowed auth failure responses before the connection is shut down
      authenticatedCallback - A callback to run when a connection authenticates successfully
    • WsSharedRWTokenAuthenticationHandler

      public WsSharedRWTokenAuthenticationHandler(String readOnlyToken, String readWriteToken, int maxAttempts, Runnable authenticatedCallback, boolean allowPaneluser)
      Constructor
      Parameters:
      readOnlyToken - The authorization token that grants read-only access
      readWriteToken - The authorization token that grants read-write access
      maxAttempts - The maximum allowed auth failure responses before the connection is shut down
      authenticatedCallback - A callback to run when a connection authenticates successfully
      allowPaneluser - Whether to allow authenticating via HTTP Headers to a PanelUser
  • Method Details