public class OAuthIdentity extends Object
OAuthFilter
class.
This class is concrete and can be instantiated as is since 1.13.0.
Application.login(HttpServletRequest, String, String)
,
OAuthFilter
Constructor and Description |
---|
OAuthIdentity(Person user,
boolean isAdministrator)
Creates a new identity instance for the specified user.
|
Modifier and Type | Method and Description |
---|---|
static OAuthIdentity |
getInstance(HttpServletRequest request)
Returns the identity associated to the request, if any.
|
Person |
getUser()
Returns the authenticated user.
|
boolean |
isAdministrator()
Returns
true if the user is an administrator in the application, false otherwise. |
static void |
setInstance(HttpServletRequest request,
OAuthIdentity identity)
Associates the specified identity to the request, meaning a user successfully authenticated to the application.
|
public OAuthIdentity(Person user, boolean isAdministrator)
user
- the user who has authenticated.isAdministrator
- determines whether the user is an administrator in the application.public static OAuthIdentity getInstance(HttpServletRequest request)
request
- the servlet request.null
otherwise.setInstance(HttpServletRequest, OAuthIdentity)
public static void setInstance(HttpServletRequest request, OAuthIdentity identity)
request
- the servlet requestidentity
- the identity of the user who has authenticated.public Person getUser()
public final boolean isAdministrator()
true
if the user is an administrator in the application, false
otherwise.true
if the user is an administrator in the application, false
otherwise.