MicroStrategy ONE
Specify Authentication Modes in iOS
When you set the preferences that are used to create a MicroStrategy session from a mobile application, you specify the authentication mode that should be used for the Mobile Server and for the MicroStrategy project. This information is stored in the ConnectionInfo.plist file. The authentication mode that you specify for the Mobile Server must match the authentication mode on the web server where the Mobile Server is located. The authentication mode you specify for the MicroStrategy project must be enabled for that project in MicroStrategy Web.
-
Mobile Server authentication modes
The authentication modes available for a Mobile Server are listed below:
Plist value Enumeration Value
Default value Anonymous
WebAuthModeAnonymous
Default
Basic
WebAuthModeBasic
Windows
WebAuthModeNTCredential
The out-of-the-box default authentication mode for the Mobile Server is "Anonymous". See the code snippet below for an illustration of how to set the authentication mode for MicroStrategy Mobile.
-
MicroStrategy project authentication modes
The authentication modes available for a MicroStrategy project are listed below:
Plist value Enumeration Value Default value Database
AuthModeWarehousePassthrough
LDAP
AuthModeLDAP
Standard
AuthModeStandard
Default
Trusted
AuthModeSimpleSecurityPlugin
Windows
AuthModeNTCredential
The out-of-the-box default authentication mode for a MicroStrategy project is "Standard", but you can set your own default authentication mode at the Mobile Server level for all the projects on that server. See the code snippet below for an illustration of how to set the authentication mode for the MicroStrategy project.
Setting the authentication modes
The code snippets below illustrate how the authentication mode is set for the Mobile Server or the MicroStrategy project. For the Mobile Server authentication mode, thesetupConnectInfoFromPlistmethod calls thewebAuthenticationModeForStringmethod ofGeneric.mand passes it the value specified in the ConnectionInfo.plist properties file. For the MicroStrategy project authentication mode, thesetupConnectInfoFromPlistmethod calls theauthenticationModeForStringmethod ofGeneric.mand passes it the value specified in the ConnectionInfo.plist properties file.
//set the other web server params
wsc.credentials.authMode = [MSIGeneric webAuthenticationModeForString:webAuthMode];
wsc.credentials.login = webUID;
wsc.credentials.password = webPwd;
}
else
{
prList = [wsc projects];
for (int projIndex = 0;projIndex < [prList size];projIndex++)
{
MSIProjectConfiguration* temp_project = [prList getProject:projIndex];
if((projectName && [temp_project.projectName isEqualToString:projectName])&&(iserver && [temp_project.serverName isEqualToString:iserver])&&(temp_project.serverPort==[serverPort intValue]))
project = temp_project;
}
}
if(project==nil)
{
project = [MSIProjectList newProjectConfiguration];
project.projectName = projectName;
project.serverName = iserver;
project.serverPort = [serverPort intValue];
[prList add:project];
//set the other project params
project.credentials.login = projUID;
project.credentials.password = projPwd;
project.credentials.authMode = [MSIGeneric authenticationModeForString:projAuthMode];
//store the results only if unique
//TQMS: 474017
[store storePreferences:dp];
}
The webAuthenticationModeForString and authenticationModeForString methods first read the authentication mode value that is passed in and then set either wsc.credentials.authMode (for the Mobile Server) or project.credentials.authMode (for the MicroStrategy project) to the appropriate enumeration value.
None
of the authentication mode inputs or appType
inputs are case-sensitive.
Setting the Mobile Server authentication mode
You can use the code snippet below as an example of how to set your own authentication mode for a Mobile Server.
(NSInteger) webAuthenticationModeForString: (NSString* )_authMode {
NSInteger authMode = WebAuthModeAnonymous //default is anonymous...
if([_authMode caseInsensitiveCompare:@"Basic"] == NSOrderedSame)
{
authMode = WebAuthModeBasic;
}
else if ([_authMode caseInsensitiveCompare:@"Windows"] == NSOrderedSame)
{
authMode = WebAuthModeNTCredential;
}
else if ([_authMode caseInsensitiveCompare:@"Default"] == NSOrderedSame)
{
authMode = WebAuthModeDefault;
}
return authMode;
}
Setting the MicroStrategy project authentication mode
You can use the code snippet below as an example of how to set your own authentication mode for a MicroStrategy project.
(NSInteger) authenticationModeForString: (NSString* )_authMode {
NSInteger authMode = AuthModeStandard //default is standard...
if([_AuthMode caseInsensitiveCompare:@"Database"] == NSOrderedSame)
{
authMode = AuthModeWarehousePassthrough
}
else if([_authMode caseInsensitiveCompare:@"LDAP"] == NSOrderedSame)
{
authMode = AuthModeLDAP
}
else if([_authMode caseInsensitiveCompare:@"Trusted"] == NSOrderedSame)
{
authMode = AuthModeSimpleSecurityPlugin;
}
else if ([_authMode caseInsensitiveCompare:@"Windows"] == NSOrderedSame)
{
authMode = AuthModeNTCredential;
}
else if ([_authMode caseInsensitiveCompare:@"Default"] == NSOrderedSame)
{
authMode = AuthModeDefault;
}
...
return authMode;
}