Class OAuthIdentity

  • All Implemented Interfaces:
    Serializable

    public class OAuthIdentity
    extends Object
    implements Serializable
    Represents the identity of a user that successfully authenticated to the application. Identity and user authentication is managed by the OAuthFilter class.

    This class is concrete and can be instantiated as is since 1.13.0.

    This class MUST no to be subclassed and will be marked final in a future release.

    Since:
    1.3.0
    See Also:
    Application.login(HttpServletRequest, String, String), OAuthFilter, Serialized Form
    • Constructor Detail

      • OAuthIdentity

        public OAuthIdentity​(Person user,
                             boolean isAdministrator)
        Creates a new identity instance for the specified user.
        Parameters:
        user - the user who has authenticated.

        Cluster-compatible applications must NOT use a subclass of Person.

        isAdministrator - determines whether the user is an administrator in the application.
        Throws:
        NullPointerException - if user is null.
    • Method Detail

      • setInstance

        public static void setInstance​(HttpServletRequest request,
                                       OAuthIdentity identity)
        Associates the specified identity to the request, meaning a user successfully authenticated to the application.
        Parameters:
        request - the servlet request
        identity - the identity of the user who has authenticated.
      • getUser

        public Person getUser()
        Returns the authenticated user.
        Returns:
        the authenticated user.
      • isAdministrator

        public final boolean isAdministrator()
        Returns true if the user is an administrator in the application, false otherwise.
        Returns:
        true if the user is an administrator in the application, false otherwise.