EducationSoftwareStrategy.com
StrategyCommunity

Knowledge Base

Product

Community

Knowledge Base

TopicsBrowse ArticlesDeveloper Zone

Product

Download SoftwareProduct DocumentationSecurity Hub

Education

Tutorial VideosSolution GalleryEducation courses

Community

GuidelinesGrandmastersEvents
x_social-icon_white.svglinkedin_social-icon_white.svg
Strategy logoCommunity

© Strategy Inc. All Rights Reserved.

LegalTerms of UsePrivacy Policy
  1. Home
  2. Topics

KB19614: How to display client IP address in User Connection Monitor when using out of box sample SSO java code for Web login in MicroStrategy Web 9.x


Community Admin

• Strategy


How to display client IP address in User Connection Monitor when using out of box sample SSO java code for Web login in MicroStrategy Web 9.x

SYMTOM
 
When using out of box Strategy SDK code, SSOESM.java, the client IP Address does not appear in the User Connection Monitor, as shown below. SSOESM.java is found under C:\Program Files\MicroStrategy\SDK\samples\java\sso.
 

ka04W000000OgaPQAS_0EM4400000028VA.jpeg

ACTION
 
To resolve this issue, add userSession.setClientID(cntSvcs.getRemoteAddress()); before userSession.getSessionID();
 
For example, the code above should be added during user session creation as shown below.
 
///////////////////////////////////////////////
//Step 4. create user session
try {
WebIServerSession userSession = WebObjectsFactory.getInstance().getIServerSession();
String project = reqKeys.getValue(EnumWebParameters.WebParameterLoginProjectName);
userSession.setProjectName(project);
userSession.setServerName(IServer);
userSession.setLogin(SSOUserID);
userSession.setPassword(pwd);
userSession.setServerPort(portNum);
// The following line of code sets the client IP Address
userSession.setClientID(cntSvcs.getRemoteAddress());
userSession.getSessionID();
String sessionState = userSession.saveState(EnumWebPersistableState.MAXIMAL_STATE_INFO);
cntSvcs.setSessionAttribute(SESSION_STATE, sessionState);
} catch (Exception e) {
errorContainer.set(new ErrorInfo(ErrorInfo.MSTR_EXCEPTION_CREATE_SESSION, e.getMessage()));
return false;
}


Comment

0 comments

Details

Knowledge Article

Published:

June 13, 2017

Last Updated:

June 13, 2017