Duo Mobile 3.2. Update for Android: Authenticate via Notification
We’ve released a new version of Duo Mobile 3.2 for Android, available now in the Google Play Store. By making the authentication process even leaner, we’ve made it faster and easier to authenticate via our two-factor authentication mobile app.
Duo Mobile now supports authentication actions via your Android notification feed (aka notification drawer), meaning you can approve or deny an authentication request without even opening the Duo Mobile app.
This feature allows you to quickly authenticate without interrupting your normal phone activity.
The Android notification feed acts as a news channel, sending you the latest activity from your apps, such as a new email or chat message. While those notifications may show you just a preview of your message, the Duo Mobile app allows you to actually authenticate securely via the notification.
Within the notification, the Duo Mobile app displays all of the information typically seen in the app interface, including the IP address, location, date and time of the authentication request.
That way, you can ensure you have all of the information you need to either approve or report fraudulent activity.
Technical Overview of Building Notifications
For those interested in the technical side of creating notifications for Android apps, here’s a more in-depth overview of creating notifications with actions for developers:
Creating notifications with actions is easy using NotificationCompat, which comes as part of Google’s official Support Library. Any method that relies on expanded notifications being supported will have no effect on devices running versions of Android below 4.1, relieving developer concerns about backward compatibility and multiple code paths.
However, even with the help of NotificationCompat, there are nuances to working with notifications and Intents that can get complicated.
Actions inside a notification are defined by an assigned PendingIntent containing an Intent that either starts an Activity, or broadcasts an Intent to any listening Broadcast Receivers. Prior to the 3.2 update, the only action available allowed users to click on the notification to open an Activity and respond to a login request.
Building and displaying a “simple” notification with one action can still look fairly verbose.
Adding an expanded view and multiple actions to a notification will look very familiar.
When the “Approve” and “Deny” actions are clicked, an Intent is broadcasted to any Broadcast Receivers registered to that action. If you are going to do any long-running task in response to an action, it is recommended to offload that work to a Service, and maintain a wake lock in the Broadcast Receiver.
In updating Duo Mobile, we utilized these concepts to create a robust workflow for responding to login requests without ever having to open the app. As a result, authenticating with Duo’s two-factor authentication on your Android device is easier than ever. Download Duo Mobile 3.2 for Android, available now in the Google Play Store.
Reach out to us!
We implemented the feature at the request of many of our users. Here at Duo, we’re always improving and streamlining our design, and we welcome your feedback! Seriously, though, we’re actually listening. Talk to us on Twitter.
For example, a message from a Duo user via Twitter: