Enum LoginState

java.lang.Object
java.lang.Enum<LoginState>
eu.webtoolkit.jwt.auth.LoginState
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<LoginState>, java.lang.constant.Constable

public enum LoginState
extends java.lang.Enum<LoginState>
Enumeration for a login state.

See Also:
Login.getState()
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    java.lang.Enum.EnumDesc<E extends java.lang.Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant Description
    DisabledLogin
    The identified user was refused to login.
    LoggedOut
    No user is currently identified.
    StrongLogin
    A user is strongly authenticated.
    WeakLogin
    A user is weakly authenticated.
  • Method Summary

    Modifier and Type Method Description
    int getValue()
    Returns the numerical representation of this enum.
    static LoginState valueOf​(java.lang.String name)
    Returns the enum constant of this type with the specified name.
    static LoginState[] values()
    Returns an array containing the constants of this enum type, in the order they are declared.

    Methods inherited from class java.lang.Enum

    clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • LoggedOut

      public static final LoginState LoggedOut
      No user is currently identified.
    • DisabledLogin

      public static final LoginState DisabledLogin
      The identified user was refused to login.

      This is caused by for example User.getStatus() returning Status#Disabled, or if email verification is required but the email hasn't been verified yet.

    • WeakLogin

      public static final LoginState WeakLogin
      A user is weakly authenticated.

      The authentication method was weak, typically this means that a secondary authentication system was used (e.g. an authentication cookie) instead of a primary mechanism (like a password).

      You may want to allow certain operations, but request to authenticate fully before more senstive operations.

    • StrongLogin

      public static final LoginState StrongLogin
      A user is strongly authenticated.
  • Method Details

    • values

      public static LoginState[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static LoginState valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
      java.lang.NullPointerException - if the argument is null
    • getValue

      public int getValue()
      Returns the numerical representation of this enum.