Class AuthenticationCredential
- java.lang.Object
-
- org.silverpeas.core.security.authentication.AuthenticationCredential
-
public class AuthenticationCredential extends Object
A credential is a set of security-related capabilities for a given user, it contains information used to authenticate him.This credential defines, among the attributes, the password, the login and the domain to which the user belongs. The domain is a repository of users having its own security policy and then its own authentication server. The login is the minimum information used in an authentication; indeed, for some security policies, the login can be a unique security token identifying uniquely a user in Silverpeas, whatever its domain, and that is known only by the user himself. For other security policies, only the login and the domain are required to authenticate the user, like in NTLM negotiation. By default, to open a WEB session with Silverpeas, the user has to authenticate himself by using both his login, his password and the domain to which he belongs.
The credential may also contain data that simply enable certain security-related capabilities like, for example, the password change. These capabilities are generally set by the authentication process from the response of the authentication server related to the user domain, once the user is successfully authenticated.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,Serializable>
getCapabilities()
Gets the security-related capabilities associated with this credential.String
getDomainId()
Gets the unique identifier of the domain to which the user belongs.String
getLogin()
Gets the user login to use in the authentication.String
getPassword()
Gets the password that is mapped with the user login.boolean
hasBeenRemotelyAuthenticated()
Is this credential comes from an external authentication mechanism?boolean
loginIgnoreCase()
Indicates if login case can be ignored during authentication processing.static AuthenticationCredential
newWithAsLogin(String login)
Creates a new authentication credential with the specified login.void
setDomainId(String domainId)
Sets the specified domain to this credential.void
setPassword(String password)
Sets the specified password to this credential.void
setRemotelyAuthenticated()
Sets the principal behind this credential has been already successfully authenticated by a remote authentication mechanism.AuthenticationCredential
withAsDomainId(String domainId)
Returns this credential with its domain attribute set with the specified value.AuthenticationCredential
withAsPassword(String password)
Returns this credential with its password attribute set with the specified value.
-
-
-
Method Detail
-
newWithAsLogin
public static AuthenticationCredential newWithAsLogin(@Defined String login) throws AuthenticationException
Creates a new authentication credential with the specified login.- Parameters:
login
- the login of the user to authenticate- Returns:
- an AuthenticationCredential instance.
- Throws:
AuthenticationException
- if the specified login isn't defined.
-
withAsPassword
public AuthenticationCredential withAsPassword(String password)
Returns this credential with its password attribute set with the specified value.- Parameters:
password
- a password.- Returns:
- itself.
-
withAsDomainId
public AuthenticationCredential withAsDomainId(String domainId)
Returns this credential with its domain attribute set with the specified value.- Parameters:
domainId
- the unique identifier of the domain to which the user belongs.- Returns:
- itself.
-
setRemotelyAuthenticated
public void setRemotelyAuthenticated()
Sets the principal behind this credential has been already successfully authenticated by a remote authentication mechanism.
-
getLogin
@Defined public String getLogin()
Gets the user login to use in the authentication.- Returns:
- the login.
-
getPassword
public String getPassword()
Gets the password that is mapped with the user login.- Returns:
- the password.
-
getDomainId
public String getDomainId()
Gets the unique identifier of the domain to which the user belongs.- Returns:
- the unique identifier of the user domain.
-
getCapabilities
public Map<String,Serializable> getCapabilities()
Gets the security-related capabilities associated with this credential. These capabilities are generally set during the authentication from the response of an authentication service.- Returns:
- a map of capabilities in which the key is the name of the capability and the value the capability value.
-
loginIgnoreCase
public boolean loginIgnoreCase()
Indicates if login case can be ignored during authentication processing.- Returns:
- true to ignore case, false to compare exactly.
-
setPassword
public void setPassword(String password)
Sets the specified password to this credential.- Parameters:
password
- a password.
-
setDomainId
public void setDomainId(String domainId)
Sets the specified domain to this credential.- Parameters:
domainId
- the unique identifier of the domain.
-
hasBeenRemotelyAuthenticated
public boolean hasBeenRemotelyAuthenticated()
Is this credential comes from an external authentication mechanism? In this case, the authentication has been already operated out of Silverpeas and the credential contains only information to identify the authenticated user.- Returns:
- true if the authentication has been already successfully done out of Silverpeas. False otherwise.
-
-