MicroStrategy ONE
LoginForm Interface
The LoginForm interface is used only when the default MicroStrategy Web log-in page is used to collect user credentials. This interface has methods that allow the External Security Module (ESM) to know what was supplied in the MicroStrategy LoginForm, including the login name and password, Intelligence Server name and port, project name, locale, and WebIServerSession object, if one exists. It also lets the ESM tell MicroStrategy Web how to proceed. If a WebIServerSession object was successfully created or retrieved, it can instruct the application to continue processing using the session ID. Otherwise, it can specify an error message to be displayed. It is called by the processMSTRLoginForm method.
The default ESM uses the LoginForm interface by default, but a custom ESM that collects credentials on the default MicroStrategy Web log-in page can also use the LoginForm interface to access information gathered on that page.
The definition of the LoginForm interface is shown in the code sample below.
package com.microstrategy.web.app;
import java.util.Locale;
import com.microstrategy.web.objects.WebIServerSession;
/**
*
*
@since MicroStrategy Web 7.3.1 or earlier
*/
public interface LoginForm {
// -----------------------------------------------------------------
// The first set of methods allow the External Security Provider
// to know what was supplied in the MicroStrategy Login Form
// -----------------------------------------------------------------
/**
* Get the value of the Login name supplied by the user
* @return a <code>String</code> with the login name given by the user
*/
public String getLoginName();
/**
* Get the value of the Password supplied by the user
* @return a <code>String</code> with the password given by the user
*/
public String getPassword();
/**
* Get the desired server name (if available)
* @return a <code>String</code> with the server name information, if provided
*/
public String getServerName();
/**
* Get the desired server port (if available)
* @return a <code>int</code> with the server port information, if provided
*/
public int getServerPort();
/**
* Get the desired server project (if available)
* @return a <code>String</code> with the server project information, if provided
*/
public String getProjectName();
/**
* Get the desired locale that the user is operating in
* @return a {@link Locale} instance representing the locale the user has selected to work with
*/
public Locale getLocale();
/**
* Get the WebIServerSession object that the Web Universal application
* would use by default. This is constructed based on the values
* collected by the Web Application.
* @return a {@link WebIServerSession} instance that the application should use
* for the current request
*/
public WebIServerSession getWebIServerSession();
// -----------------------------------------------------------------
// The next set of methods allow the External Security Provider
// to inform Web Universal application on how to proceed.
// -----------------------------------------------------------------
/**
* If the data supplied in the login form was successfully used to
* construct a WebIServerSession, then the External Security Provider
* should set the Form Status to true. If there was an error in the
* form data or a WebIServerSession could not be constructed,
* then the External Security Provider should set this value to false.
* @param status <code>boolean<code> indicating the form status to assign.
*/
public void setFormStatus(boolean status);
/**
* If the Form Status is false, then the External Security Provider
* can specify an error message for the Web Universal application
* to display. If no message is provided (null), then the Web Application
* will provide a generic error message.
* @param errMsg <code>String</code> with the error message to assign.
*/
public void setFormErrorMessage(String errMsg);
/**
* If the Form Status is true, then the External Security Provider
* can specify the WebIServerSession object to use.
* @param session {@link WebIServerSession} instance to be used.
*/
public void setWebIServerSession(WebIServerSession session);
// -----------------------------------------------------------------
// The remaining methods are merely the corresponding getters
// and setters.
// -----------------------------------------------------------------
/**
* Set the value of the Login name supplied by the user
* @param loginName <code>String</code> with the login name given by the user
*/
public void setLoginName(String loginName);
/**
* Set the value of the Password supplied by the user
* @param password <code>String</code> with the password given by the user
*/
public void setPassword(String password);
/**
* Set the desired server name
* @param serverName <code>String</code> with the server name information
*/
public void setServerName(String serverName);
/**
* Set the desired server port
* @param serverPort <code>int</code> with the server port information
*/
public void setServerPort(int serverPort);
/**
* Set the desired server project
* @param projectName <code>String</code> with the server project information
*/
public void setProjectName(String projectName);
/**
* Set the desired locale that the user is operating in
* @param locale {@link Locale} instance representing the locale the user has selected to work with
*/
public void setLocale(Locale locale);
/**
* If the data supplied in the login form was successfully used to
* construct a WebIServerSession, then the External Security Provider
* set the Form Status to true. If there was an error in the
* form data or a WebIServerSession could not be constructed,
* then the External Security Provider set this value to false.
* @return <code>boolean<code> indicating the form status to assign.
*/
public boolean getFormStatus();
/**
* If the Form Status is false, then the External Security Provider
* can specify an error message for the Web Universal application
* to display.
* @return <code>String</code> with the error message to assign.
* If no message is provided (null), then the Web Application
* can provide a generic error message.
*/
public String getFormErrorMessage();
}