Enum Class IdentityPolicy

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

public enum IdentityPolicy extends Enum<IdentityPolicy>
Enumeration for an identity policy.

This enumeration lists possible choices for the user identity (login name).

When using password authentication, it is clear that the user has to provide an identity to login. The only choice is whether you will use the user's email address or another login name.

When using a 3rd party authenticator, e.g. using OAuth, a login name is no longer needed, but you may still want to give the user the opportunity to choose one.

See Also:
  • Enum Constant Details

    • LoginName

      public static final IdentityPolicy LoginName
      A unique login name chosen by the user.

      Even if not really required for authentication, a user still chooses a unique user name. If possible, a third party autheticator may suggest a user name.

      This may be useful for sites which have a social aspect.

    • EmailAddress

      public static final IdentityPolicy EmailAddress
      The email address serves as the identity.

      This may be useful for sites which do not have any social character, but instead render a service to individual users. When the site has a social character, you will likely not want to display the email address of other users, but instead a user-chosen login name.

    • Optional

      public static final IdentityPolicy Optional
      An identity is optional, and only asked if needed for authentication.

      Unless the authentication procedure requires a user name, no particular identity is asked for. In this case, the identity is a unique internal identifier.

      This may be useful for sites which do not have any social character, but instead render a service to individual users.

  • Method Details

    • values

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

      public static IdentityPolicy valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getValue

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