Understand the Oracle Mobile Hub Environment
Oracle Mobile Hub is designed to support mobile app development and use. Use it to set up backends that handle authentication and routing for one or more APIs that your mobile apps can access.
You can use one or more of the built-in platform APIs that provide services such as notifications, location services, storage, offline and sync, and database access.
Oracle Mobile Hub can also host custom APIs that you write. Oracle provides SDKs for Android, iOS, Cordova, React Native, and Javascript web apps that make developing apps easier.
Your custom APIs can use Oracle Mobile Hub Connectors which route connections from your mobile apps to third party applications like Google Maps or OpenWeatherMap. Connectors introduce a level of indirection which allows you to translate your custom API calls into the proper format for the external service. In addition, you can use them to handle authentication with the external service, and to combine multiple requests from your app into a single REST call.
Backends
A backend plays a similar role as a web server, but instead of hosting web pages, it hosts APIs and other artifacts. Your mobile apps can access resources on Oracle Mobile Hub only through the backend that you create.
After creating the backend, you associate one or more APIs with it. The associated APIs are accessed through the backend, which provides the base URL for the API. The backend also handles authentication and authorization tasks for the API. You can use OAuth or Basic Authentication to authenticate users. You can also assign roles to your mobile users and then restrict access to the backend based on a user's role.
If you are using push notifications, you can create a notifications profile in Oracle Mobile Hub to manage credentials from notification suppliers such as Google, Apple, and Syniverse. You then associate your client app with the notifications profile.
Authentication Methods
Several methods are available for authenticating users of your apps.
In Oracle Mobile Hub, all resources are secured and can be accessed only by authenticated users who are authorized to access those resources. In most cases you can enable more than one authentication method for a backend.
Backends support the following authentication methods: OAuth 2.0, HTTP Basic Authentication, Enterprise Single Sign-On (SSO), and Facebook Login.
- OAuth 2.0
-
OAuth consumer keys are generated for you when you create the backend, in the form of a client ID and a client secret.
- HTTP Basic
-
HTTP Basic Access keys are generated for you in the form of a backend ID and an anonymous key when you create the backend.
- Enterprise Single Sign-On
-
You can use your own IdP for users of your apps by creating a trust relationship between your IdP and Oracle Mobile Cloud. This allows your company’s employees to sign into the apps using their existing credentials. It can also be used in consumer applications where the customers already have user accounts for other purposes.
You can also use SAML tokens or JWT tokens from a third-party IdP, and browser-based SSO using Oracle Identity Cloud Service as the IdP.
Oracle Mobile Hub supports the use of SAML and JWT tokens in the following ways:- With zero footprint SSO, where no user accounts are stored in Oracle. Instead, all of the information for the user, including user roles, is derived from the third-party token. Such users are referred to as virtual users.
- With a token that identifies a user that has been provisioned in both Oracle Identity Cloud Service and the third-party IdP. Roles are associated for the user based on information provided in Oracle Identity Cloud Service.
- Facebook Login
-
This authentication method is useful for apps that target consumers. but it requires you to register your app with Facebook. Also, other authentication methods in the backend are not available when using Facebook login.
Mobile Users and Roles
You create users and then assign them access to your apps. You can then use roles to restrict that access.
You can create users in Oracle Identity Cloud Service, through a third-party IdP, or by using Facebook login authentication. A REST API is available in Oracle Identity Cloud Service that allows you to create and manage users and groups in bulk.
After users are created, you assign them access to your apps. You can also add users to a group and then give the group access to your apps.
You can create roles in Oracle Mobile Cloud and then specify access for those roles. You can specify which roles have access to an API, or to one or more endpoints of an API. Role-based access is not available when using Facebook login.
Client SDKs
Oracle provides client SDKs for the following platforms and frameworks: Android, iOS, Cordova, JavaScript, and React Native.
The SDKs provide platform-specific wrapper classes that make it easier to use Oracle Mobile Hub.
You can download the SDKs from the Oracle Mobile Hub download page at https://www.oracle.com/technetwork/topics/cloud/downloads/amce-downloads-4478270.html. The names of the SDKs on the download page follow the legacy product names, but the code that they contain is up to date with the latest release.
Built-in Persistence Layer
Each backend has its own persistence layer, implemented as an SQL Database.
Your apps can access the database through the Database Access API and the Database Management API. These two APIs together give you the ability to create, read, update, and delete tables and rows using SQL commands.
Mobile apps cannot access the database directly. The database is accessible only via REST API calls made from custom APIs.
App Policies API
Use the App Policies API to create read-only custom properties in a backend and access them in your mobile app with REST calls.
App policies are custom properties that you can define and adjust in a backend and then reference from your apps through a REST API. You can update app policies anytime, even after you have published the backend. This lets you make changes to the appearance and behavior of a deployed app without having to update the app itself.
For example, your app can rely on a policy to determine whether or not to display a section for holiday sales to your users. You can also store configuration details such as names of images to use, fonts, colors, and other details that affect the look and feel of your app.
Diagnostics
The diagnostics features of Oracle Mobile Hub provide live performance data and quick access to detailed log messages for each API and connector request.
Developers can use these features to help debug their code. Administrators can use these features to monitor performance and error rates and to debug any problems that arise.
The Diagnostics landing page provides a high-level view that includes a traffic-light indicator that conveys overall environmental health, a timeline that plots requests and responses, and counters that display HTTP 4xx and HTTP 5xx errors. You can drill down from an indicator or an error counter to identify which requests are failing and view the log records that are associated with them.