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

KB442048:Seamless Login Using Microstrategy Mobile Integrated with Blackberry SDK


Ahmed Osman

Senior Consultant • Strategy


This example shows how to setup a single sign-on to login into MicroStrategy using the Blackberry authorized user.

Introduction


This example shows how to setup a single sign-on to login into Strategy using the Blackberry authorized user. This can be done by using Trusted authentication to authenticate against Strategy using the Blackberry authenticated user as the trusted user.

Instructions


Using a custom App Delegate, it is possible to get the Blackberry User ID and set the corresponding header value that the Mobile Server expects. In "didFinishLaunchingWithOptions" you can use the following observer to get the GD user ID:
 


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

//    CustomLoginView *loginView = [[CustomLoginView alloc] initWithFrame:self.window.frame];
//    MSIAuthenticationPromptViewController *loginViewController = [[MSIAuthenticationPromptViewController alloc] init];
//    MSIAuthenticationModule *loginModule = [[MSIAuthenticationModule alloc] init];
//    [[MSIMobileLoginManager sharedMobileLoginManager] setView:loginView controller:loginViewController module:loginModule forPromptType:AuthenticationPromptType];

    NSLog(@"CUSTOM APP DELEGATE DID FINISH LAUNCHING");
    relaunched = true;
    // this notification is triggered when GD authorization has finished.
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(getGDID) name:MSI_APPLICATION_DID_FINISH_LAUNCHING_NOTIFICATION object:nil];
    BOOL res = [super application:application didFinishLaunchingWithOptions:launchOptions];
    return res;
}

-(void) getGDID {
    if(!relaunched){
        NSLog(@"not relaunched");
        return;
    }
    NSLog(@"relaunched");
    NSLog(@"Finished Initialization");
    NSDictionary *gdApplicationConfig = [[GDiOS sharedInstance] getApplicationConfig];
    //NSLog(@"gdApplicationConfig is: %@", gdApplicationConfig);
    NSString *userID = gdApplicationConfig[@"userId"];
    NSLog(@"userID is: %@", userID);
    // setting header values -
    SDKEnvSettings *sdkEnvSettings = [MSIGeneric getSDKEnvSettings];
    [sdkEnvSettings setValue:userID forHTTPHeaderField:@"SM_USER"];
    // prevent it from being called again in this run cycle
    relaunched = false;
}

When using trusted authentication Strategy Web/Mobile look for a header key in the incoming request and it checks its value to identify the trusted user. For more details regarding Trusted Authentication refer to the following references:
https://www2.microstrategy.com/producthelp/Current/SystemAdmin/WebHelp/Lang_1033/Content/Enabling_Single_Sign_on_to_Web__Mobile__and_Office.htm
https://community.Strategy.com/s/article/KB35502-How-to-configure-Trusted-authentication-with-Siteminder
https://www2.microstrategy.com/producthelp/Current/WebSDK/Content/topics/sso/WEBSDK_SSO004.htm
 


Comment

0 comments

Details

Example

Published:

September 28, 2018

Last Updated:

February 14, 2024