Class AuthenticatedUser
java.lang.Object
net.sf.basedb.core.authentication.AuthenticatedUser
public class AuthenticatedUser extends Object
Objects of this class are returned by the
AuthenticationManager.authenticate()
method and contains information about the authenticated
user. This class provide information about the login and/or
external id for the user as well as the AuthenticationMethod
that was used. Additional information for the user
may be provided by ExtraUserInformation
.- Since:
- 3.3
- Author:
- Nicklas
-
Field Summary
Fields Modifier and Type Field Description private String
externalId
private ExtraUserInformation
extraInfo
private int
internalId
private String
login
private AuthenticationMethod
method
-
Constructor Summary
Constructors Constructor Description AuthenticatedUser(AuthenticationMethod method, String login, String externalId)
Creates a newAuthenticatedUser
object without any link to an existing user in BASE.AuthenticatedUser(AuthenticationMethod method, UserData user)
Creates a newAuthenticatedUser
object with a link to an existing user in BASE. -
Method Summary
Modifier and Type Method Description AuthenticationMethod
getAuthenticationMethod()
Get the authentication method that was used to verify the login.String
getExternalId()
Get the external id for the user.ExtraUserInformation
getExtraInformation()
Get extra information about the user.int
getInternalId()
Get the internal id for the user (0 if not known)String
getLogin()
Get the login string for the user.boolean
hasExtraInformation()
Check if extra information about the user has been provided.void
setExtraInformation(ExtraUserInformation extraInfo)
Set extra information about the user.
-
Field Details
-
method
-
login
-
externalId
-
internalId
private final int internalId -
extraInfo
-
-
Constructor Details
-
AuthenticatedUser
Creates a newAuthenticatedUser
object without any link to an existing user in BASE.- Parameters:
method
- The authentication method used to verify the userlogin
- The login nameexternalId
- The unique externalId of the user
-
AuthenticatedUser
Creates a newAuthenticatedUser
object with a link to an existing user in BASE.- Parameters:
method
- The authentication method used to verify the useruser
- The UserData object for an existing user
-
-
Method Details
-
getAuthenticationMethod
Get the authentication method that was used to verify the login. -
getLogin
Get the login string for the user. -
getExternalId
Get the external id for the user. -
getInternalId
public int getInternalId()Get the internal id for the user (0 if not known) -
hasExtraInformation
public boolean hasExtraInformation()Check if extra information about the user has been provided. -
getExtraInformation
Get extra information about the user. -
setExtraInformation
Set extra information about the user.
-