Closed VictorKimbi closed 1 year ago
@VictorKimbi Kindly provide the logs to investigate further. To provide logs kindly follow: https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-logging-ios?tabs=objc and send MSAL logs to swagup@microsoft.com
This issue has been automatically marked as stale because it has not had recent activity. Please provide additional information if requested. Thank you for your contributions.
No active conversation for 2 months, closing @VictorKimbi feel free to reopen if the issue was not resolved
Hello, I need help! my application is failing to prompt the user for login details below is my code, I am not sure if the
(BOOL)application:(UIApplication )application didFinishLaunchingWithOptions:(NSDictionary )launchOptions { NSError *msalError = nil;
MSALPublicClientApplicationConfig config = [[MSALPublicClientApplicationConfig alloc] initWithClientId:kClientID]; NSArray<NSString > *scopes = @[@"api://aadapp-dw_global-nonprod.investec.io/user_impersonation"];
MSALPublicClientApplication *app = [[MSALPublicClientApplication alloc] initWithConfiguration:config error:&msalError];
ifdef FB_SONARKIT_ENABLED
InitializeFlipper(application);
endif
// Define UNUserNotificationCenter UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter]; center.delegate = self;
if ([FIRApp defaultApp] == nil) { [FIRApp configure]; }
RCTBridge bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions]; RCTRootView rootView = [[RCTRootView alloc] initWithBridge:bridge moduleName:@"Investec" initialProperties:nil];
rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; UIViewController *rootViewController = [UIViewController new];
rootViewController.view = [RNInvappRootDetection configure:rootView];
if TARGET_OS_IPHONE
//UIStoryboard loginStoryBoard = [UIStoryboard storyboardWithName:@"ViewController" bundle:nil]; //UIViewController loginViewController = [loginStoryBoard instantiateViewControllerWithIdentifier:@"LoginPage"]; //UIViewController viewController = rootViewController; // Pass a reference to the view controller that should be used when getting a token interactively MSALWebviewParameters webParameters = [[MSALWebviewParameters alloc] initWithAuthPresentationViewController:rootViewController]; MSALInteractiveTokenParameters parameters = [[MSALInteractiveTokenParameters alloc] initWithScopes:scopes webviewParameters:webParameters]; parameters.promptType = MSALPromptTypeLogin; NSLog(@"Looking for Parameters"); [app acquireTokenWithParameters:parameters completionBlock:^(MSALResult result, NSError *error) { //acquireTokenBlock(result.accessToken, error); }]; self.window.rootViewController = rootViewController; [self.window makeKeyAndVisible];
else
MSALWebviewParameters *webParameters = [MSALWebviewParameters new];
endif
return YES; }