- All Implemented Interfaces:
public enum IdentityPolicy extends java.lang.Enum<IdentityPolicy>
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.
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 DescriptionThe email address serves as the identity.A unique login name chosen by the user.An identity is optional, and only asked if needed for authentication.
Modifier and Type Method Description
()Returns the numerical representation of this enum.
(java.lang.String name)Returns the enum constant of this type with the specified name.
()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
LoginNameIdentitypublic static final IdentityPolicy LoginNameIdentityA 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.
EmailAddressIdentitypublic static final IdentityPolicy EmailAddressIdentityThe 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.
OptionalIdentitypublic static final IdentityPolicy OptionalIdentityAn 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.
valuespublic static IdentityPolicy values()Returns an array containing the constants of this enum type, in the order they are declared.
- an array containing the constants of this enum type, in the order they are declared
valueOfpublic 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.)
name- the name of the enum constant to be returned.
- the enum constant with the specified name
java.lang.IllegalArgumentException- if this enum type has no constant with the specified name
java.lang.NullPointerException- if the argument is null
getValuepublic int getValue()Returns the numerical representation of this enum.