Integrating Your App with Appdome DEV-Events and OneLogin MFA Service

OneLogin MFA is a feature that allows you to add Multi-Factor Authentication to your app. Appdome is a mobile integration platform as a service (iPaaS) that allows users to add a wide variety of features, SDKs, and APIs to Android and iOS apps.

For more information about OneLogin MFA and how to use Appdome to integrate it into your app, see: Adding OneLogin MFA to Your App.

This Knowledgebase article provides step by step instructions for integrating Appdome DEV-Events™ with LoginMFA service to any Android and iOS mobile app. With DEV-Events you can use Appdome to handle in apps events and complete LoginMFA authentication internally.

Prerequisites for Using OneLogin MFA

In order to use Appdome’s no code implementation of OneLogin MFA on Appdome, you’ll need:

Adding DEV-Events™ Code to Your App

DEV-Events™ events are coded in the application as the simplest method available to developers: in Android they implement Broadcasts and in iOS, they are push notifications. To let Appdome handle OneLogin with DEV-Events™ events, follow this flow in the app’s code:

  1. The application sends an event with ID OneLoginLoginEvent with keys “OneLoginUsername” and “OneLoginPassword” with their respective values
  2. Appdome implementation of OneLogin, after submitting the username and password and obtaining the result will return the result to the application in event “OneLoginResultEvent” with status under key “OneLoginResult”

Assuming you have needed values in String objects:

Android

To send a DEV-Events™ event on Android, simply send a broadcast:

Bundle data = new Bundle();
data.putString(key, value);
Intent intent = new Intent(eventID);
intent.putExtras(data);
context.sendBroadcast(intent);

To receive an event on Android, simply create a BroadcastReciever and register it for events you need to receive:


BroadcastReceiver eventsReceiver = new BroadcastReceiver() {
    @Override
    public void onReceive(Context context, Intent intent) {
         Bundle extras = intent.getExtras();
         String event = intent.getAction();
         if(event.compareTo("OneLoginLoginEvent") == 0) {
             if(extras != null && extras.containsKey("OneLoginResult")) {
                String result = extras.getString("OneLoginResult");
                //handle the status, string "true" for success, string "false" for failure
            }   
         } 
    }
};

public void init(Context context) {
   this.context = context;
   reciever = new BroadcastReceiver() {
       @Override
       public void onReceive(Context context, Intent intent) {
          onEvent(intent);
       }
};
   context.registerReceiver(eventsReceiver, new IntentFilter("OneLoginResult")); 
};
      

iOS

To send and receive DEV-Events™ events on iOS:


- (void)setUpListeners {
    // this notification will indicate identification process is done and notify us of success or failure of identification
    [[NSNotificationCenter defaultCenter] addObserverForName: @"OneLoginLoginEvent" object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *note) {
        bool success = [[[note userInfo] objectForKey: @"OneLoginResult"] boolValue];
        // identification is done, "success" indicates success of identification operation
    }];
}

// app sends username and password to OneLogin service for authentication
- (void)sendLogin {
    NSMutableDictionary *userInfo = [[NSMutableDictionary alloc] init];
    [userInfo setObject: @"my_username" forKey: @"OneLoginUsername"];
    [userInfo setObject: @"my_password" forKey: @"OneLoginPassword"];
    [[NSNotificationCenter defaultCenter] postNotificationName: @"OneLoginLoginEvent" object:nil userInfo: userInfo];
}

Fusing your app with OneLogin DEV-Events™ support

  1. Click the Build TabNote: a blue underline will appear showing the step is active
  2. Click the Identity category
  3. Toggle “ON” Identity Services
  4. Select OneLogin MFA from the list
  5. Enter the app’s Client ID 
  6. Enter the app’s Client Secret
  7. Enter your OneLogin Subdomain
  8. Choose your API Region
  9. API URL (optional): If you are using an alternative OneLogin server, enter here. Otherwise, leave blank. By default, Appdome’s OneLogin implementation will use “https://myOneLogin.org“
  10. Toggle “ON” Authenticate on Resource to initiate OneLogin protection on resource access. Verification will initiate when the app gets a “not authenticated” response from a server. Toggle “ON” Authenticate on App Launch to initiate OneLogin protection on application launch. Click + Add to add a server URL wildcard to the list of servers you want to protect
  11. Toggle “OFF” Dynamic UI™ to enable DEV-Events
  12. Click the Build My App button to complete Appdome’s OneLogin integration into the app.

Congratulations! You now have a mobile app fully integrated with OneLogin


After Adding OneLogin to a Mobile App on Appdome

After you have added OneLogin to any Mobile App on Appdome, there are a few additional steps needed to complete your mobile integration project.

Add Context™ to the Appdome Built App

Appdome is a full-featured mobile integration platform. Within Context™, Appdome users can brand the app, including adding a favicon to denote the new service added to the app.
For more information on the range of options available in Context™, please read this knowledge base article.

Sign the OneLogin MFA Enabled Appdome Built App (Required)

In order to deploy an Appdome Built app, it must be signed. Signing iOS apps and Signing Android apps are easy using Appdome. Alternatively, you can use Private Signing, download your unsigned app and sign locally using your own signing methods.

Deploy the Appdome-Built App to a Mobile Device

Once you have signed your Appdome Built app, you can download to deploy it using your distribution method of choice. For more information on deploying your Appdome Built apps, please read this knowledge base.

That is it – Enjoy Appdome for OneLogin in your app!

How Do I Learn More?

Request a demo at any time.

If you have any questions, please send them our way at support@appdome.com or via the chat window on the Appdome platform.

Thank you!

Thanks for visiting Appdome! Our mission is to make mobile integration easy. We hope we’re living up to the mission with your project. If you don’t already have an account, you can sign up for free.

Kai Kenan

Have a question?

Ask an expert

ThomasMaking your security project a success!