public class LoginContext extends Object implements Serializable
forceAuth
- Should user authentication be forced (default value: false).passiveAuth
- Should user authentication not control the UI (default value: false).Map
<String, Object> is provided to store other properties. Alternatively, a profile handler may
create a subclass of LoginContext with extra fields.
LoginContexts should be created by a profile handler when authentication is needed. Once control has returned to the
profile handler, it should remove the LoginContext from the HttpSession.
The AuthenticationEngine
should set the setAuthenticationAttempted()
,
setPrincipalAuthenticated(boolean)
,
setAuthenticationFailure(AuthenticationException)
, appropriately.修飾子とタイプ | フィールドと説明 |
---|---|
static String |
LOGIN_CONTEXT_KEY
the key in a HttpSession where login contexts are stored.
|
コンストラクタと説明 |
---|
LoginContext()
Creates a new instance of LoginContext.
|
LoginContext(boolean force,
boolean passive)
Creates a new instance of LoginContext.
|
修飾子とタイプ | メソッドと説明 |
---|---|
String |
getAttemptedAuthnMethod()
Gets the authentication method that was used when attempting to authenticate the user.
|
boolean |
getAuthenticationAttempted()
Returns if authentication has been attempted for this user.
|
long |
getAuthenticationDuration()
Gets the duration of authentication.
|
String |
getAuthenticationEngineURL()
Gets the authentication engine's URL.
|
AuthenticationException |
getAuthenticationFailure()
Gets the error that occurred during authentication.
|
org.joda.time.DateTime |
getAuthenticationInstant()
Gets the authentication instant.
|
String |
getAuthenticationMethod()
Gets the method used to authenticate the user.
|
AuthenticationMethodInformation |
getAuthenticationMethodInformation()
Gets information about the authentication event.
|
String |
getDefaultAuthenticationMethod()
Gets the authentication method to use if none is requested.
|
String |
getPrincipalName()
Returns the ID of the authenticated user.
|
String |
getProfileHandlerURL()
Gets the ProfileHandler URL.
|
Object |
getProperty(String key)
Get an optional property object.
|
String |
getRelyingPartyId()
Gets the entity ID of the relying party.
|
List<String> |
getRequestedAuthenticationMethods()
Return the acceptable authentication handler URIs, in preference order, for authenticating this user.
|
String |
getSessionID()
Gets the
Session ID. |
boolean |
isForceAuthRequired()
Returns if authentication must be forced.
|
boolean |
isPassiveAuthRequired()
Returns if authentication must be passive.
|
boolean |
isPrincipalAuthenticated()
Returns if authentication succeeded.
|
void |
setAttemptedAuthnMethod(String method)
Sets the authentication method that was used when attempting to authenticate the user.
|
void |
setAuthenticationAttempted()
Set if authentication has been attempted.
|
void |
setAuthenticationDuration(long duration)
推奨されていません。
this information is contained in the
AuthenticationMethodInformation |
void |
setAuthenticationEngineURL(String url)
Sets the authentication engine's URL.
|
void |
setAuthenticationFailure(AuthenticationException error)
Sets the error that occurred during authentication.
|
void |
setAuthenticationInstant(org.joda.time.DateTime instant)
推奨されていません。
this information is contained in the
AuthenticationMethodInformation |
void |
setAuthenticationMethod(String method)
推奨されていません。
this information is contained in the
AuthenticationMethodInformation |
void |
setAuthenticationMethodInformation(AuthenticationMethodInformation info)
Sets the information about the authentication event.
|
void |
setDefaultAuthenticationMethod(String method)
Sets the authentication method to use if none is requested.
|
void |
setForceAuthRequired(boolean force)
Sets if authentication must be forced.
|
void |
setPassiveAuthRequired(boolean passive)
Sets if authentication must be passive.
|
void |
setPrincipalAuthenticated(boolean authnOK)
Sets if authentication succeeded.
|
void |
setPrincipalName(String id)
推奨されていません。
this information is contained in the
AuthenticationMethodInformation |
void |
setProfileHandlerURL(String url)
Sets the ProfileHandler URL.
|
void |
setProperty(String key,
Serializable obj)
Sets an optional property object.
|
void |
setRelyingParty(String id)
Gets the entity ID of the relying party.
|
void |
setSessionID(String id)
Sets the
Session ID. |
public LoginContext()
public LoginContext(boolean force, boolean passive)
force
- if the authentication manager must re-authenticate the user.passive
- if the authentication manager must not interact with the users UI.public String getAttemptedAuthnMethod()
getAuthenticationMethodInformation()
.public boolean getAuthenticationAttempted()
public long getAuthenticationDuration()
public String getAuthenticationEngineURL()
public AuthenticationException getAuthenticationFailure()
public org.joda.time.DateTime getAuthenticationInstant()
null
if none was set.public String getAuthenticationMethod()
public AuthenticationMethodInformation getAuthenticationMethodInformation()
public String getDefaultAuthenticationMethod()
public String getPrincipalName()
null
if authentication failed.public String getProfileHandlerURL()
public Object getProperty(String key)
key
- The key in the properties Map.null
is no object exists for the key.public String getRelyingPartyId()
public List<String> getRequestedAuthenticationMethods()
public boolean isForceAuthRequired()
true
if the authentication manager must re-authenticate the user.public boolean isPassiveAuthRequired()
true
if the authentication manager must not interact with the users UI.public boolean isPrincipalAuthenticated()
true
is the user was successfully authenticated.public void setAttemptedAuthnMethod(String method)
method
- authentication method that was used when attempting to authenticate the userpublic void setAuthenticationAttempted()
LoginHandler
while processing a request.public void setAuthenticationDuration(long duration)
AuthenticationMethodInformation
duration
- The duration of authentication.public void setAuthenticationEngineURL(String url)
url
- the URL of the authentication enginepublic void setAuthenticationFailure(AuthenticationException error)
error
- error that occurred during authenticationpublic void setAuthenticationInstant(org.joda.time.DateTime instant)
AuthenticationMethodInformation
instant
- The instant of authentication.public void setAuthenticationMethod(String method)
AuthenticationMethodInformation
method
- The method used to authenticate the user.public void setAuthenticationMethodInformation(AuthenticationMethodInformation info)
info
- information about the authentication eventpublic void setDefaultAuthenticationMethod(String method)
method
- authentication method to use if none is requested, may be null which indicates any method may be
usedpublic void setForceAuthRequired(boolean force)
force
- if the authentication manager must re-authenticate the user.public void setPassiveAuthRequired(boolean passive)
passive
- if the authentication manager must not interact with the users UI.public void setPrincipalAuthenticated(boolean authnOK)
authnOK
- if authentication succeeded;public void setPrincipalName(String id)
AuthenticationMethodInformation
id
- The userid.public void setProfileHandlerURL(String url)
url
- The URL of the profile handler that invoked the AuthenticationManager/public void setProperty(String key, Serializable obj)
key
- The key to set.obj
- The object to associate with key.public void setRelyingParty(String id)
id
- entity ID of the relying partyCopyright © 2012. All Rights Reserved.