-
Field Summary
Fields
Administrator of the user-manager database
The special role name used for logged in users.
-
Method Summary
void
Reset the login, making the user anonymous
Return the type of authentication used
Get all the (verified) claims for this user.
default org.joda.time.DateTime
Get the instant when the login must expire (or null if it will never expire or has not come through an authentication
system that uses expiration)
Get the name of the current user
Get the username of the current user
default boolean
default boolean
Return true if the user is not authenticated
boolean
default boolean
void
Change to represent the named user
Methods inherited from interface com.peterphi.std.guice.common.auth.iface.CurrentUser
format, format, format, getDateFormatter, getRoles, getSimpleClaim, getSimpleListClaim, getSimpleSetClaim, getTimeZone, hasRole, isDelegated, isService
-
Field Details
-
SESSION_RECONNECT_COOKIE
static final String SESSION_RECONNECT_COOKIE
- See Also:
-
-
ROLE_LOGGED_IN
static final String ROLE_LOGGED_IN
The special role name used for logged in users. The empty string is also permitted
- See Also:
-
-
ROLE_ADMIN
static final String ROLE_ADMIN
Administrator of the user-manager database
- See Also:
-
-
Method Details
-
clear
void clear()
Reset the login, making the user anonymous
-
reload
Change to represent the named user
- Parameters:
account
-
-
isAdmin
default boolean isAdmin()
-
isLocal
boolean isLocal()
-
getName
Get the name of the current user
- Specified by:
getName
in interface CurrentUser
- Returns:
- the name if known, otherwise null
-
-
-
getExpires
default org.joda.time.DateTime getExpires()
Get the instant when the login must expire (or null if it will never expire or has not come through an authentication
system that uses expiration)
- Specified by:
getExpires
in interface CurrentUser
- Returns:
-
getAuthType
Return the type of authentication used
- Specified by:
getAuthType
in interface CurrentUser
- Returns:
-
isLoggedIn
default boolean isLoggedIn()
-
isAnonymous
default boolean isAnonymous()
Return true if the user is not authenticated
- Specified by:
isAnonymous
in interface CurrentUser
- Returns:
- true if the user is not authenticated, false if the user is authenticated
-
getUsername
Get the username of the current user
- Specified by:
getUsername
in interface CurrentUser
- Returns:
- the username if known, otherwise null if not logged in (i.e. anonymous)
-
getClaims
Get all the (verified) claims for this user. The returned collection MUST NOT be modified.
Returns an empty collection if no claims were made
- Specified by:
getClaims
in interface CurrentUser
- Returns:
-