Package com.microstrategy.web.tasks
Class LoginTask
- java.lang.Object
-
- com.microstrategy.web.tasks.AbstractBaseTask
-
- com.microstrategy.web.tasks.LoginTask
-
- All Implemented Interfaces:
Task
- Direct Known Subclasses:
AppLoginTask,MobileLoginTask,UsherRegisterUserTask
public class LoginTask extends AbstractBaseTask
A simpleTaskthat logs a user into an Intelligence Server.- Since:
- MicroStrategy Web 8.1.0
-
-
Field Summary
Fields Modifier and Type Field Description protected TaskParameterMetadataapplicationTypeTaskParamprotected TaskParameterMetadataauthModeTaskParamstatic java.lang.StringBLOCK_NAME_LOGINTASKDATAThe name of the Block that should contain the resulting task response.protected TaskParameterMetadataloginTaskParamstatic java.lang.StringPARAM_NAME_APPLICATION_TYPEThe application type making the request.static java.lang.StringPARAM_NAME_AUTH_MODEThe name of the authentication mode parameter.static java.lang.StringPARAM_NAME_LThe name of the user ID parameter.static java.lang.StringPARAM_NAME_PThe name of the password parameter.static java.lang.StringPARAM_NAME_PORTThe name of the port parameter.static java.lang.StringPARAM_NAME_PROJECTThe name of the project parameter.static java.lang.StringPARAM_NAME_SERVERThe name of the server parameter.static java.lang.StringPARAM_NAME_TWO_STEP_VERIFICATION_CODEThe name of the two-step verification code parameterprotected TaskParameterMetadatapasswordTaskParamprotected TaskParameterMetadataportTaskParamprotected TaskParameterMetadataprojectTaskParamprotected static java.lang.StringPROP_NAME_LOGINTASKDATA_NAMEThe name of the property that holds the user's login name.static java.lang.StringPROP_NAME_LOGINTASKDATA_SESSION_STATEThe name of the session ID property in the Block.protected TaskParameterMetadataserverTaskParamprotected TaskParameterMetadatatsvCodeTaskParam-
Fields inherited from class com.microstrategy.web.tasks.AbstractBaseTask
compressOutput, CONTENT_TYPE_BINARY, CONTENT_TYPE_HTML, CONTENT_TYPE_JSON, CONTENT_TYPE_JSON_ALL, CONTENT_TYPE_JSON_D, CONTENT_TYPE_JSON_P, CONTENT_TYPE_XML, CONTENT_TYPE_XML_ANF, DEFAULT_MAX_WAIT, DEFAULT_POLLING_FREQ, execFlagsParam, INDEFINITE_MAX_WAIT, maxWaitParam, metadata, mPrivileges, msgIDParam, objectIDParam, OTHER_CONTENT_KEY_LAYOUTS, PARAM_NAME_EXEC_FLAGS, PARAM_NAME_MAX_WAIT, PARAM_NAME_MESSAGE_ID, PARAM_NAME_OBJECT_ID, PARAM_NAME_POLLING_FREQ, PARAM_NAME_RESULT_FLAGS, PARAM_NAME_SESSION_ID, PARAM_NAME_SESSION_STATE, PARAM_NAME_STATE_ID, pollingFreqParam, PREFERENCE_DEFAULT_MAX_WAIT_IN_TASK, resultFlagsParam, sessionIDParam, sessionStateParam, stateIDParam
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidbuildResponse(TaskOutput taskOutput, TaskRequestContext context, WebIServerSession wiss)protected voidcheckAuthParameters(java.lang.String server, int port, java.lang.String project, java.lang.String l, java.lang.String p, int authMode)Ensures various authentication parameters are correctly configured, such as validating the server name is not an empty string.protected voidcheckSession(TaskRequestContext context, WebIServerSession wiss)protected java.lang.Stringconfigure(Block block, TaskRequestContext context, WebIServerSession wiss)protected voidconfigureWebIServerSession(TaskRequestContext context, WebIServerSession wiss, java.lang.String server, int port, java.lang.String project, java.lang.String l, java.lang.String p, int authMode)protected voidconfigureWebIServerSession(TaskRequestContext context, WebIServerSession wiss, java.lang.String server, int port, java.lang.String project, java.lang.String l, java.lang.String p, int authMode, java.lang.String twoStepVerificationCode, java.lang.String accessToken)protected voidconfigureWebIServerSession(TaskRequestContext context, WebIServerSession wiss, java.lang.String server, int port, java.lang.String project, java.lang.String l, java.lang.String p, int authMode, java.lang.String twoStepVerificationCode, java.lang.String accessToken, java.lang.String orgID)protected java.lang.StringgetAccessToken(TaskRequestContext context)protected booleanisAuthModeEnabled(TaskRequestContext context, WebIServerSession session)voidprocessRequest(TaskRequestContext context, TaskOutput taskOutput)Creates an Intelligence Server session using the information supplied in the request.-
Methods inherited from class com.microstrategy.web.tasks.AbstractBaseTask
addExecFlagsParam, addJuilLayouts, addMaxWaitParam, addMaxWaitParam, addMessageIDParam, addObjectIDParam, addParameterMetadata, addParameterMetadata, addParameterMetadata, addPollingFrequencyParam, addPollingFrequencyParam, addResultFlagsParam, addSessionIDParam, addSessionStateParam, addStateIDParam, checkForRequiredParameters, destroy, getCompressOutput, getID, getMetadata, getPrivileges, getSysDefaultPreferenceValue, init, newRequestContext, processRequest, retrieveUploadedFile, setCompressOutput, setDescription, setID, setMetadata, setPrivileges, validateContentType
-
-
-
-
Field Detail
-
PARAM_NAME_SERVER
public static final java.lang.String PARAM_NAME_SERVER
The name of the server parameter.- See Also:
- Constant Field Values
-
PARAM_NAME_P
public static final java.lang.String PARAM_NAME_P
The name of the password parameter.- See Also:
- Constant Field Values
-
PARAM_NAME_L
public static final java.lang.String PARAM_NAME_L
The name of the user ID parameter.- See Also:
- Constant Field Values
-
PARAM_NAME_PROJECT
public static final java.lang.String PARAM_NAME_PROJECT
The name of the project parameter.- See Also:
- Constant Field Values
-
PARAM_NAME_AUTH_MODE
public static final java.lang.String PARAM_NAME_AUTH_MODE
The name of the authentication mode parameter.- See Also:
- Constant Field Values
-
PARAM_NAME_PORT
public static final java.lang.String PARAM_NAME_PORT
The name of the port parameter.- Since:
- MicroStrategy Web 8.1.2
- See Also:
- Constant Field Values
-
PARAM_NAME_APPLICATION_TYPE
public static final java.lang.String PARAM_NAME_APPLICATION_TYPE
The application type making the request.- See Also:
EnumDSSXMLApplicationType, Constant Field Values
-
PARAM_NAME_TWO_STEP_VERIFICATION_CODE
public static final java.lang.String PARAM_NAME_TWO_STEP_VERIFICATION_CODE
The name of the two-step verification code parameter- See Also:
- Constant Field Values
-
BLOCK_NAME_LOGINTASKDATA
public static final java.lang.String BLOCK_NAME_LOGINTASKDATA
The name of the Block that should contain the resulting task response.- See Also:
- Constant Field Values
-
PROP_NAME_LOGINTASKDATA_SESSION_STATE
public static final java.lang.String PROP_NAME_LOGINTASKDATA_SESSION_STATE
The name of the session ID property in the Block.- See Also:
- Constant Field Values
-
PROP_NAME_LOGINTASKDATA_NAME
protected static final java.lang.String PROP_NAME_LOGINTASKDATA_NAME
The name of the property that holds the user's login name.- See Also:
- Constant Field Values
-
serverTaskParam
protected TaskParameterMetadata serverTaskParam
-
projectTaskParam
protected TaskParameterMetadata projectTaskParam
-
loginTaskParam
protected TaskParameterMetadata loginTaskParam
-
passwordTaskParam
protected TaskParameterMetadata passwordTaskParam
-
authModeTaskParam
protected TaskParameterMetadata authModeTaskParam
-
applicationTypeTaskParam
protected TaskParameterMetadata applicationTypeTaskParam
-
portTaskParam
protected TaskParameterMetadata portTaskParam
- Since:
- MicroStrategy Web 8.1.2
-
tsvCodeTaskParam
protected TaskParameterMetadata tsvCodeTaskParam
-
-
Method Detail
-
processRequest
public void processRequest(TaskRequestContext context, TaskOutput taskOutput) throws TaskException
Creates an Intelligence Server session using the information supplied in the request.- Specified by:
processRequestin interfaceTask- Overrides:
processRequestin classAbstractBaseTask- Parameters:
context- TheTaskRequestContextobject that maintains the state of the request.taskOutput- TheTaskOutputthat records the contents of the Task response.- Throws:
TaskException- If the Task is unable to obtain a Block to store the results.TaskRequestMalformedException- If any of the information is incorrect.- Since:
- MicroStrategy Web 9.0.0
- See Also:
Task.processRequest(TaskRequestContext, TaskOutput)
-
getAccessToken
protected java.lang.String getAccessToken(TaskRequestContext context)
-
checkSession
protected void checkSession(TaskRequestContext context, WebIServerSession wiss) throws TaskException
- Throws:
TaskException
-
buildResponse
protected void buildResponse(TaskOutput taskOutput, TaskRequestContext context, WebIServerSession wiss) throws TaskException
- Throws:
TaskException
-
configure
protected java.lang.String configure(Block block, TaskRequestContext context, WebIServerSession wiss) throws TaskException
- Throws:
TaskException
-
configureWebIServerSession
protected void configureWebIServerSession(TaskRequestContext context, WebIServerSession wiss, java.lang.String server, int port, java.lang.String project, java.lang.String l, java.lang.String p, int authMode) throws TaskException
- Throws:
TaskException
-
configureWebIServerSession
protected void configureWebIServerSession(TaskRequestContext context, WebIServerSession wiss, java.lang.String server, int port, java.lang.String project, java.lang.String l, java.lang.String p, int authMode, java.lang.String twoStepVerificationCode, java.lang.String accessToken) throws TaskException
- Throws:
TaskException
-
configureWebIServerSession
protected void configureWebIServerSession(TaskRequestContext context, WebIServerSession wiss, java.lang.String server, int port, java.lang.String project, java.lang.String l, java.lang.String p, int authMode, java.lang.String twoStepVerificationCode, java.lang.String accessToken, java.lang.String orgID) throws TaskException
- Throws:
TaskException
-
checkAuthParameters
protected void checkAuthParameters(java.lang.String server, int port, java.lang.String project, java.lang.String l, java.lang.String p, int authMode) throws TaskExceptionEnsures various authentication parameters are correctly configured, such as validating the server name is not an empty string.- Throws:
TaskException- thrown if parameters fails this preliminary authentication check.- Since:
- MicroStrategy Web 8.1.2
-
isAuthModeEnabled
protected boolean isAuthModeEnabled(TaskRequestContext context, WebIServerSession session) throws TaskException
- Throws:
TaskException
-
-