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 simpleTask
that logs a user into an Intelligence Server.- Since:
- MicroStrategy Web 8.1.0
-
-
Field Summary
Fields Modifier and Type Field Description protected TaskParameterMetadata
applicationTypeTaskParam
protected TaskParameterMetadata
authModeTaskParam
static java.lang.String
BLOCK_NAME_LOGINTASKDATA
The name of the Block that should contain the resulting task response.protected TaskParameterMetadata
loginTaskParam
static java.lang.String
PARAM_NAME_APPLICATION_TYPE
The application type making the request.static java.lang.String
PARAM_NAME_AUTH_MODE
The name of the authentication mode parameter.static java.lang.String
PARAM_NAME_L
The name of the user ID parameter.static java.lang.String
PARAM_NAME_LOGIN
Deprecated.static java.lang.String
PARAM_NAME_P
The name of the password parameter.static java.lang.String
PARAM_NAME_PASSWORD
Deprecated.static java.lang.String
PARAM_NAME_PORT
The name of the port parameter.static java.lang.String
PARAM_NAME_PROJECT
The name of the project parameter.static java.lang.String
PARAM_NAME_SERVER
The name of the server parameter.static java.lang.String
PARAM_NAME_TWO_STEP_VERIFICATION_CODE
The name of the two-step verification code parameterprotected TaskParameterMetadata
passwordTaskParam
protected TaskParameterMetadata
portTaskParam
protected TaskParameterMetadata
projectTaskParam
protected static java.lang.String
PROP_NAME_LOGINTASKDATA_NAME
The name of the property that holds the user's login name.static java.lang.String
PROP_NAME_LOGINTASKDATA_SESSION_STATE
The name of the session ID property in the Block.protected TaskParameterMetadata
serverTaskParam
protected TaskParameterMetadata
tsvCodeTaskParam
-
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 void
buildResponse(TaskOutput taskOutput, TaskRequestContext context, WebIServerSession wiss)
protected void
checkAuthParameters(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 void
checkSession(TaskRequestContext context, WebIServerSession wiss)
protected java.lang.String
configure(Block block, TaskRequestContext context, WebIServerSession wiss)
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)
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)
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)
protected java.lang.String
getAccessToken(TaskRequestContext context)
protected boolean
isAuthModeEnabled(TaskRequestContext context, WebIServerSession session)
void
processRequest(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_PASSWORD
@Deprecated public static final java.lang.String PARAM_NAME_PASSWORD
Deprecated.- 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_LOGIN
@Deprecated public static final java.lang.String PARAM_NAME_LOGIN
Deprecated.- 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:
processRequest
in interfaceTask
- Overrides:
processRequest
in classAbstractBaseTask
- Parameters:
context
- TheTaskRequestContext
object that maintains the state of the request.taskOutput
- TheTaskOutput
that 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 TaskException
Ensures 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
-
-