Class SignInPermissions

java.lang.Object
com.iizix.device.SignInPermissions
All Implemented Interfaces:
Cloneable

public final class SignInPermissions extends Object implements Cloneable
Sign in permissions class.
Author:
Christopher Mindus
  • Field Details

    • NONE

      public static final SignInPermissions NONE
      The sign-in permissions with nothing allowed.
  • Method Details

    • getTokenizedString

      public String getTokenizedString()
      Returns the permission as a tokenized string.
      Returns:
      The tokenized string.
      Throws:
      IllegalArgumentException - In case of token errors.
    • isAllowed

      public boolean isAllowed()
      Get the flag for sign-in storing of parameters is allowed. If denied, everything is disabled.
      Returns:
      The flag.
    • isRememberUserAllowed

      public boolean isRememberUserAllowed()
      Gets the flag enabling "Remember User" (not password) settings on the device in question.
      Returns:
      The flag.
    • isRememberPasswordAllowed

      public boolean isRememberPasswordAllowed()
      Gets the flag enabling "Remember Password" (for user/password) settings on the device in question.
      Returns:
      The flag.
    • isBiometricsRequired

      public boolean isBiometricsRequired()
      Gets the flag indicating biometric authentication is required.
      Returns:
      The flag.
    • isExternalAuthenticatorRequired

      public boolean isExternalAuthenticatorRequired()
      Gets the flag indicating External Authenticator program required, e.g. MFA authentication using a TOTP based QR code.
      Returns:
      The flag.
    • isAdminPasswordEntropyStrengthRequired

      public boolean isAdminPasswordEntropyStrengthRequired()
      Gets the flag indicating Administrator password strength entropy is required.
      Returns:
      The flag.
    • isAutoSignInUserPasswordAllowed

      public boolean isAutoSignInUserPasswordAllowed()
      Gets the flag indicating auto-sign with user + password is allowed.
      Returns:
      The flag.
    • isAutoSignInProviderAllowed

      public boolean isAutoSignInProviderAllowed()
      Gets the flag indicating auto-sign with user + sign-in provider is allowed.
      Returns:
      The flag.
    • equals

      public boolean equals(Object o)
      Checks if two instances are equal.
      Overrides:
      equals in class Object
      Parameters:
      o - The object to compare with.
      Returns:
      The equality flag.
    • hashCode

      public int hashCode()
      Returns a hash code value for the object.
      Overrides:
      hashCode in class Object
      Returns:
      The hash code.
    • toString

      public String toString()
      Gets the string representation of this instance with all "allow" or "required" parameters.
      Overrides:
      toString in class Object
      Returns:
      The string representation e.g. "NothingAllowed" or a comma separated string of value pairs such as "isRememberUserAllowed=true/false".
    • builder

      public static SignInPermissions builder()
      Creates the builder of sign-in permissions.
      Returns:
      The instance of the sign-in permission class with everything NOT ALLOWED.
    • fromTokens

      public SignInPermissions fromTokens(String tokens)
      Creates the sign-in permissions from an initial permissions set combined with an additional saved set.
      Parameters:
      tokens - The tokens string of previous set of permissions.
      Returns:
      The new permissions instance, or the same if there is no difference.
      Throws:
      IllegalArgumentException - In case of token errors.
    • withAllowed

      public SignInPermissions withAllowed()
      Creates a new instance with "allowed", by default no permissions are allowed at all.
      Returns:
      The new instance of the class, or the same if flag is already set.
    • withAllowed

      public SignInPermissions withAllowed(boolean on)
      Creates a new instance with "allowed", by default no permissions are allowed at all.
      Parameters:
      on - Enablement flag.
      Returns:
      The new instance of the class, or the same if flag is already set.
    • withRememberUserAllowed

      public SignInPermissions withRememberUserAllowed()
      Creates a new instance with "Remember User Allowed" (not password).
      Returns:
      The new instance of the class, or the same if flag is already set.
    • withRememberUserAllowed

      public SignInPermissions withRememberUserAllowed(boolean on)
      Creates a new instance with "Remember User Allowed" (not password).
      Parameters:
      on - Enablement flag.
      Returns:
      The new instance of the class, or the same if flag is already set.
    • withRememberPasswordAllowed

      public SignInPermissions withRememberPasswordAllowed()
      Creates a new instance with "Remember Password Allowed" (for user).
      Returns:
      The new instance of the class, or the same if flag is already set.
    • withRememberPasswordAllowed

      public SignInPermissions withRememberPasswordAllowed(boolean on)
      Creates a new instance with "Remember Password Allowed" (for user).
      Parameters:
      on - Enablement flag.
      Returns:
      The new instance of the class, or the same if flag is already set.
    • withBiometricsRequired

      public SignInPermissions withBiometricsRequired()
      Creates a new instance with "Biometrics Required" enabled.
      Returns:
      The new instance of the class, or the same if flag is already set.
    • withBiometricsRequired

      public SignInPermissions withBiometricsRequired(boolean on)
      Creates a new instance with "Biometrics Required" enabled.
      Parameters:
      on - Enablement flag.
      Returns:
      The new instance of the class, or the same if flag is already set.
    • withExternalAuthenticatorRequired

      public SignInPermissions withExternalAuthenticatorRequired()
      Creates a new instance with flag enabling "External Authenticator Required" settings on the device in question.
      Returns:
      The new instance of the class, or the same if flag is already set.
    • withExternalAuthenticatorRequired

      public SignInPermissions withExternalAuthenticatorRequired(boolean on)
      Creates a new instance with flag enabling "External Authenticator Required" settings on the device in question.
      Parameters:
      on - Enablement flag.
      Returns:
      The new instance of the class, or the same if flag is already set.
    • withAdminPasswordEntropyStrengthRequired

      public SignInPermissions withAdminPasswordEntropyStrengthRequired()
      Creates a new instance with "Admin Password Entropy Strength Required" enabled.
      Returns:
      The new instance of the class, or the same if flag is already set.
    • withAdminPasswordEntropyStrengthRequired

      public SignInPermissions withAdminPasswordEntropyStrengthRequired(boolean on)
      Creates a new instance with "Admin Password Entropy Strength Required" enabled.
      Parameters:
      on - Enablement flag.
      Returns:
      The new instance of the class, or the same if flag is already set.
    • withAutoSignInUserPasswordAllowed

      public SignInPermissions withAutoSignInUserPasswordAllowed()
      Creates a new instance with "Auto Sign-InUser Password/Allowed" enabled.
      Returns:
      The new instance of the class, or the same if flag is already set.
    • withAutoSignInUserPasswordAllowed

      public SignInPermissions withAutoSignInUserPasswordAllowed(boolean on)
      Creates a new instance with "Auto Sign-InUser Password/Allowed" enabled.
      Parameters:
      on - Enablement flag.
      Returns:
      The new instance of the class, or the same if flag is already set.
    • withAutoSignInProviderAllowed

      public SignInPermissions withAutoSignInProviderAllowed()
      Creates a new instance with "Auto Sign-InUser Password/Allowed" enabled.
      Returns:
      The new instance of the class, or the same if flag is already set.
    • withAutoSignInProviderAllowed

      public SignInPermissions withAutoSignInProviderAllowed(boolean on)
      Creates a new instance with "Auto Sign-In Provider Allowed" enabled.
      Parameters:
      on - Enablement flag.
      Returns:
      The new instance of the class, or the same if flag is already set.