Enum IdentityPolicy

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<IdentityPolicy>

    public enum IdentityPolicy
    extends java.lang.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:
    AuthService.setIdentityPolicy(IdentityPolicy identityPolicy)
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      EmailAddress
      The email address serves as the identity.
      LoginName
      A unique login name chosen by the user.
      Optional
      An identity is optional, and only asked if needed for authentication.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getValue()
      Returns the numerical representation of this enum.
      static IdentityPolicy valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static IdentityPolicy[] 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, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

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

      • 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 Detail

      • values

        public static IdentityPolicy[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (IdentityPolicy c : IdentityPolicy.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static IdentityPolicy 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.