|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.faces.component.UIComponent
javax.faces.component.UIComponentBase
javax.faces.component.UIOutput
javax.faces.component.UIInput
com.sun.webui.jsf.component.WebuiInput
com.sun.webui.jsf.component.Login
public class Login
The Login component provides an authentication presentation layer that can plug in different authentication technologies at the backend. The component currently supports JAAS based authentication. This component is an EditableValueHolder. There are essentially two threads in play here - the presentation layer's thread and a controller thread that performs the actual authentication. Interaction between the two threads happens during the validation phase of the JSF lifecycle. The interaction happens via a callback object that originates from the underlying authentication implementation class. This callback object contains a list of input fields that need to be displayed on the client side for user data entry. During validation the component can be in one of three states based on the state of the client and the underlying authentication mechanism:
Field Summary |
---|
Fields inherited from class javax.faces.component.UIInput |
---|
COMPONENT_FAMILY, COMPONENT_TYPE, CONVERSION_MESSAGE_ID, REQUIRED_MESSAGE_ID, UPDATE_MESSAGE_ID |
Fields inherited from interface javax.faces.component.NamingContainer |
---|
SEPARATOR_CHAR |
Constructor Summary | |
---|---|
Login()
Construct a new Login . |
Method Summary | |
---|---|
java.util.Map |
getAuthenticationKeys()
Returns a map containing a mapping between the IDs of the callback data objects as supplied by the underlying authentication infrastructure and their corresponding clientIDs for the corresponding JSF components. |
com.sun.webui.jsf.model.login.LoginCallback |
getCallbackObject()
Get the LoginCallback object. |
java.lang.String |
getFamily()
Return the family for this component. |
java.lang.String |
getHtmlTemplate()
Get alternative HTML template to be used by this component. |
java.lang.String |
getLoginClass()
Return the name of the login module implementation class where the request came from. |
java.lang.String |
getLoginController()
Get the login controller implementation class name. |
com.sun.webui.jsf.model.login.LoginConstants.LOGINSTATE |
getLoginState()
Defines the state of the authentication process. |
java.lang.String |
getRedirectURL()
Get the URL to which the user should be redirected upon successful authentication. |
java.lang.String |
getRendererType()
Return the renderer type for this component. |
java.lang.String |
getServiceName()
Get the name of the JAAS login service from configuration file. |
java.lang.String |
getStyle()
Get the CSS style(s) to be applied to the outermost HTML element when the component is rendered. |
java.lang.String |
getStyleClass()
Get the CSS style class(es) to be applied to the outermost HTML element when this component is rendered. |
int |
getTabIndex()
Position of this element in the tabbing order of the current document. |
boolean |
isAutoStart()
A boolean attribute indicating if the login component should initiate the authentication process on its own without any client side intervention or wait for some other client side entity to start the authentication process. |
boolean |
isImmediate()
Flag indicating that event handling for this component should be handled immediately (in Apply Request Values phase) rather than waiting until Invoke Application phase. |
void |
processDecodes(javax.faces.context.FacesContext context)
Override the default UIComponent.processDecodes(javax.faces.context.FacesContext)
processing to perform the following steps. |
void |
processValidators(javax.faces.context.FacesContext context)
Validation of user entered data is done by posting them as key value pairs to callback object. |
void |
restoreState(javax.faces.context.FacesContext _context,
java.lang.Object _state)
Restore the state of this component. |
java.lang.Object |
saveState(javax.faces.context.FacesContext _context)
Save the state of this component. |
void |
setAuthenticationKeys(java.util.Map keys)
Sets a map containing a mapping between the IDs of the callback data objects as supplied by the underlying authentication infrastructure and their corresponding clientIDs for the corresponding JSF components. |
void |
setAutoStart(boolean autoStart)
Set autoStart to false to control the time when authentication should start. |
void |
setCallbackObject(com.sun.webui.jsf.model.login.LoginCallback callbackObject)
Sets the LoginCallback object for use during the Render Response phase. |
void |
setHtmlTemplate(java.lang.String htmlTemplate)
Set alternative HTML template to be used by this component. |
void |
setImmediate(boolean immediate)
Flag indicating that event handling for this component should be handled immediately (in Apply Request Values phase) rather than waiting until Invoke Application phase. |
void |
setLoginClass(java.lang.String loginClass)
Set the name of the login module implementation class where the request came from. |
void |
setLoginController(java.lang.String loginController)
Set the Login controller implementation class. |
void |
setLoginState(com.sun.webui.jsf.model.login.LoginConstants.LOGINSTATE loginState)
Sets the current state of the authentication process. |
void |
setRedirectURL(java.lang.String redirectURL)
Set the URL to which the user should be redirected upon successful authentication. |
void |
setServiceName(java.lang.String serviceName)
Set the name of the JAAS login service from configuration file. |
void |
setStyle(java.lang.String style)
Set the CSS style(s) to be applied to the outermost HTML element when the component is rendered. |
void |
setStyleClass(java.lang.String styleClass)
Set the CSS style class(es) to be applied to the outermost HTML element when this component is rendered. |
void |
setTabIndex(int tabIndex)
Position of this element in the tabbing order of the current document. |
void |
updateModel(javax.faces.context.FacesContext context)
Perform the following algorithm to update the model data associated with this UIInput, if any, as appropriate. |
void |
validate(javax.faces.context.FacesContext context)
Interaction with the underlying authentication infrastructure takes place in this method. |
Methods inherited from class com.sun.webui.jsf.component.WebuiInput |
---|
broadcast, getValidator, getValidatorExpression, getValueChangeListener, getValueChangeListenerExpression, processUpdates, setConverter, setId, setRendered, setRequired, setValidatorExpression, setValueChangeListenerExpression |
Methods inherited from class javax.faces.component.UIInput |
---|
addValidator, addValueChangeListener, decode, getConverterMessage, getRequiredMessage, getSubmittedValue, getValidatorMessage, getValidators, getValueChangeListeners, isLocalValueSet, isRequired, isValid, removeValidator, removeValueChangeListener, resetValue, setConverterMessage, setLocalValueSet, setRequiredMessage, setSubmittedValue, setValid, setValidator, setValidatorMessage, setValue, setValueChangeListener |
Methods inherited from class javax.faces.component.UIOutput |
---|
getConverter, getLocalValue, getValue |
Methods inherited from class javax.faces.component.UIComponentBase |
---|
encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRendersChildren, getValueBinding, getValueExpression, invokeOnComponent, isRendered, isTransient, processRestoreState, processSaveState, queueEvent, restoreAttachedState, saveAttachedState, setParent, setRendererType, setTransient, setValueBinding, setValueExpression |
Methods inherited from class javax.faces.component.UIComponent |
---|
encodeAll, getContainerClientId |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.faces.component.ValueHolder |
---|
getConverter, getLocalValue, getValue |
Constructor Detail |
---|
public Login()
Construct a new Login
.
Method Detail |
---|
public java.lang.String getFamily()
Return the family for this component.
getFamily
in class javax.faces.component.UIInput
public java.lang.String getRendererType()
Return the renderer type for this component.
getRendererType
in class javax.faces.component.UIComponentBase
public java.lang.String getHtmlTemplate()
public void setHtmlTemplate(java.lang.String htmlTemplate)
public com.sun.webui.jsf.model.login.LoginConstants.LOGINSTATE getLoginState()
Defines the state of the authentication process. The states should be one of the following: INIT - initialization of authentication process CONTINUE - authentication process currently in progress, and SUCCESS - authentication process completed successfully. FAILURE - authentication process has ended in failure.
public void setLoginState(com.sun.webui.jsf.model.login.LoginConstants.LOGINSTATE loginState)
getLoginState()
public void setAuthenticationKeys(java.util.Map keys)
Sets a map containing a mapping between the IDs of the callback data objects as supplied by the underlying authentication infrastructure and their corresponding clientIDs for the corresponding JSF components. This information is required to extract the data entered by the user from the request header map.
public java.util.Map getAuthenticationKeys()
Returns a map containing a mapping between the IDs of the callback data objects as supplied by the underlying authentication infrastructure and their corresponding clientIDs for the corresponding JSF components. This information is required to extract the data entered by the user from the request header map.
public boolean isAutoStart()
A boolean attribute indicating if the login component should initiate the authentication process on its own without any client side intervention or wait for some other client side entity to start the authentication process. By default this attribute is set to true. In situations where the authentication process needs to start based on other events happening on the client side this attribute should be set to false and the appropriate client side API used to fire up the process.
public void setAutoStart(boolean autoStart)
Set autoStart to false to control the time when authentication should start.
isAutoStart()
public java.lang.String getLoginClass()
Return the name of the login module implementation class where the request came from. This information is needed by the callback handler to prompt users for data or figure out error conditions.
public void setLoginClass(java.lang.String loginClass)
Set the name of the login module implementation class where the request came from. This information is needed by the callback handler to prompt users for data or figure out error conditions.
public java.lang.String getRedirectURL()
Get the URL to which the user should be redirected upon successful authentication.
public void setRedirectURL(java.lang.String redirectURL)
Set the URL to which the user should be redirected upon successful authentication.
getRedirectURL()
public java.lang.String getServiceName()
Get the name of the JAAS login service from configuration file. The name of an entry in the JAAS login configuration file. This is the name for the LoginContext to use to look up an entry for this application in the JAAS login configuration file, described here. Such an entry specifies the class(es) that implement the desired underlying authentication technology(ies).
public void setServiceName(java.lang.String serviceName)
Set the name of the JAAS login service from configuration file.
getServiceName()
public java.lang.String getLoginController()
Get the login controller implementation class name. If this attribute is not supplied the default JAAS controller will be used. This attribute provides the application developer to use a non JAAS based authentication implementation with the same presentation layer.
public void setLoginController(java.lang.String loginController)
Set the Login controller implementation class.
* @see #getLoginController()
public java.lang.String getStyle()
Get the CSS style(s) to be applied to the outermost HTML element when the component is rendered.
public void setStyle(java.lang.String style)
Set the CSS style(s) to be applied to the outermost HTML element when the component is rendered.
public java.lang.String getStyleClass()
Get the CSS style class(es) to be applied to the outermost HTML element when this component is rendered.
public void setStyleClass(java.lang.String styleClass)
Set the CSS style class(es) to be applied to the outermost HTML element when this component is rendered.
public boolean isImmediate()
Flag indicating that event handling for this component should be handled immediately (in Apply Request Values phase) rather than waiting until Invoke Application phase. May be desired for this component when required is true (although most likely not).
isImmediate
in interface javax.faces.component.EditableValueHolder
isImmediate
in class javax.faces.component.UIInput
public void setImmediate(boolean immediate)
Flag indicating that event handling for this component should be handled immediately (in Apply Request Values phase) rather than waiting until Invoke Application phase. May be desired for this component when required is true (although most likely not).
setImmediate
in interface javax.faces.component.EditableValueHolder
setImmediate
in class WebuiInput
isImmediate()
public int getTabIndex()
Position of this element in the tabbing order of the current document. Tabbing order determines the sequence in which elements receive focus when the tab key is pressed. The value must be an integer between 0 and 32767.
public void setTabIndex(int tabIndex)
Position of this element in the tabbing order of the current document. Tabbing order determines the sequence in which elements receive focus when the tab key is pressed. The value must be an integer between 0 and 32767.
getTabIndex()
public com.sun.webui.jsf.model.login.LoginCallback getCallbackObject()
Get the LoginCallback object. The callback object that contains information sent by the underlying authentication layer to be used for generating presentation data that is transmitted to the client side. The callback object is made available during the validation phase of the component and contains entries that correspond to input elements that need to be displayed at the client for users to enter authentication data.
public void setCallbackObject(com.sun.webui.jsf.model.login.LoginCallback callbackObject)
getCallbackObject()
public void processDecodes(javax.faces.context.FacesContext context)
Override the default UIComponent.processDecodes(javax.faces.context.FacesContext)
processing to perform the following steps.
rendered
property of this UIComponent
is false
, skip further processing.
processDecodes
in class WebuiInput
context
- FacesContext
for the current request
java.lang.NullPointerException
- if context
is null
public void processValidators(javax.faces.context.FacesContext context)
Validation of user entered data is done by posting them as key value pairs to callback object. The callback object is read by the underlying authentication implementation classes in order to authenticate the user.
rendered
property of this UIComponent
is false
, skip further processing.
processValidators
in class WebuiInput
context
- FacesContext
for the current request
java.lang.NullPointerException
- if context
is null
public void validate(javax.faces.context.FacesContext context)
Interaction with the underlying authentication infrastructure takes place in this method. By default the JAAS implementation of the controller is instantiated and used for interacting with the underlying the JAAS infrastructure. If the application has supplied a different implementation that would be used. Once the controller is instantiated the authentication process is initiated and its result rendered. The object is the stored in the session. Subsequent invocations of this method would cause the object to be retrieved and based on the status of the callback object act accordingly. If an exception is encountered the controller invokes abort thereby stopping all activities in the backend. Failure sets the component state to invalid and success sets the valid state to true, sets the local value of the component.
validate
in class javax.faces.component.UIInput
context
- FacesContext
for the current request
java.lang.NullPointerException
- if context
is null
public void updateModel(javax.faces.context.FacesContext context)
updateModel
in class javax.faces.component.UIInput
public void restoreState(javax.faces.context.FacesContext _context, java.lang.Object _state)
Restore the state of this component.
restoreState
in interface javax.faces.component.StateHolder
restoreState
in class WebuiInput
public java.lang.Object saveState(javax.faces.context.FacesContext _context)
Save the state of this component.
saveState
in interface javax.faces.component.StateHolder
saveState
in class WebuiInput
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |