The OMI Showcase App is a sample app that gives implementation examples of every feature provided by the OMI Mobile SDK. Please have a look at theGetting started page, if you want more information about how to get setup with this sample app.
Before you can compile the application it must be able to resolve it's dependencies. The Onegini Android SDK is one of those dependencies. We have an Artifactory repository that distributes the required dependencies. Make sure that you have access to the Onegini Artifactory repository (https://thalescpliam.jfrog.io). If you don't have access, no problem just go to the App developer quickstart and perform the first step. Access to Artifactory is required to let Gradle download the Onegini Android SDK library.
When you have access you have to make sure that your Artifactory username and password are set in the gradle.properties file in your
Gradle user home
(e.g. ~/.gradle):
Example contents of the gradle.properties file in you Gradle user home:
artifactory_user=<username>
artifactory_password=<password>
See the documentation below for instructions on setting Gradle properties: https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_properties_and_system_properties
To use Firebase Cloud Messaging, replacement of app/google-services.json with file downloaded from your own project
on Firebase Console is needed.
If you ignore this step, you won't be able to receive push messages from the backend.
- Create a new project on Firebase Console.
- Navigate to project settings and create two new Android apps with following application IDs:
com.onewelcome.showcaseapp.developercom.onewelcome.showcaseapp.internal
- Download the
google-services.jsonfile and replace it with sampleapp/google-services.jsonpresent in the project.
Alternatively, if internal build variant is not needed, you can create just com.onewelcome.showcaseapp.developer project and edit the
content for the developer part inside the sample file.
- Now, you need to setup Push Messaging Configuration on the backend side. To do that, navigate again to your project on Firebase Console -> Project settings -> Cloud messaging. Click on Manage Service Accounts and Create Service Account with Cloud Messaging permissions and copy its Key ID. Next, open your backend admin web page and navigate to Configuration -> Mobile authentication -> Push messaging configuration. Create new configuration and upload the Key.
For more information on how to set up Firebase Messaging, please take a look at Google Documentation.
To begin mobile authentication, call the backend API, which will either generate an OTP code or send a push notification to the user’s device. The backend provides the following endpoint for this purpose:
POST /oauth/api/v4/authenticate/user
Detailed documentation and usage examples are available in the Access mobile authentication documentation.
For mobile authentication using OTP, a convenient way to test is as follows: copy the otp value from the API response and paste it
into an online QR Code generator. You can then scan the generated QR code using the OMI Showcase App.