Enum Class IdentityPolicy
- All Implemented Interfaces:
Serializable
,Comparable<IdentityPolicy>
,Constable
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
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionThe 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. -
Method Summary
Modifier and TypeMethodDescriptionint
getValue()
Returns the numerical representation of this enum.static IdentityPolicy
Returns the enum constant of this class with the specified name.static IdentityPolicy[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
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
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
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
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
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 nameNullPointerException
- if the argument is null
-
getValue
public int getValue()Returns the numerical representation of this enum.
-