Interface AuthenticationSystem

All Known Implementing Classes:
DefaultAuthentication

public interface AuthenticationSystem
Defines an authenticator for the server. Can be changed by plugins.
  • Method Details

    • createAccount

      void createAccount(String username, String password)
      Called when a user requests to make an account.
      Parameters:
      username - The provided username.
      password - The provided password. (SHA-256'ed)
    • resetPassword

      void resetPassword(String username)
      Called when a user requests to reset their password.
      Parameters:
      username - The username of the account to reset.
    • verifyUser

      boolean verifyUser(String details)
      Called by plugins to internally verify a user's identity.
      Parameters:
      details - A unique, one-time token to verify the user.
      Returns:
      True if the user is verified, False otherwise.
    • getPasswordAuthenticator

      Authenticator<LoginResultJson> getPasswordAuthenticator()
      This is the authenticator used for password authentication.
      Returns:
      An authenticator.
    • getTokenAuthenticator

      Authenticator<LoginResultJson> getTokenAuthenticator()
      This is the authenticator used for token authentication.
      Returns:
      An authenticator.
    • getSessionKeyAuthenticator

      Authenticator<ComboTokenResJson> getSessionKeyAuthenticator()
      This is the authenticator used for session authentication.
      Returns:
      An authenticator.
    • getExternalAuthenticator

      ExternalAuthenticator getExternalAuthenticator()
      This is the authenticator used for handling external authentication requests.
      Returns:
      An authenticator.
    • fromPasswordRequest

      static AuthenticationSystem.AuthenticationRequest fromPasswordRequest(express.http.Request request, LoginAccountRequestJson jsonData)
      Generates an authentication request from a LoginAccountRequestJson object.
      Parameters:
      request - The Express request.
      jsonData - The JSON data.
      Returns:
      An authentication request.
    • fromTokenRequest

      static AuthenticationSystem.AuthenticationRequest fromTokenRequest(express.http.Request request, LoginTokenRequestJson jsonData)
      Generates an authentication request from a LoginTokenRequestJson object.
      Parameters:
      request - The Express request.
      jsonData - The JSON data.
      Returns:
      An authentication request.
    • fromComboTokenRequest

      static AuthenticationSystem.AuthenticationRequest fromComboTokenRequest(express.http.Request request, ComboTokenReqJson jsonData, ComboTokenReqJson.LoginTokenData tokenData)
      Generates an authentication request from a ComboTokenReqJson object.
      Parameters:
      request - The Express request.
      jsonData - The JSON data.
      Returns:
      An authentication request.
    • fromExternalRequest

      static AuthenticationSystem.AuthenticationRequest fromExternalRequest(express.http.Request request, express.http.Response response)
      Generates an authentication request from a Response object.
      Parameters:
      request - The Express request.
      response - the Express response.
      Returns:
      An authentication request.