Configuring Oracle Mobile Cloud Service While Creating Enterprise Mobile App
While developing an Enterprise Mobile App using Oracle Mobile Cloud Service (MCS), one needs to configure MCS to make sure it works we need. This configuration is done after deploying PLSQL Package as REST Service. And in this tutorial, I will be using Smart Expenses Approval developed by our team to walk you through the steps needed to be performed.
Oracle Mobile Cloud Service Architecture
Oracle MCS is Mobile Backend as a Service (MBaaS) that allows you to rapidly build mobile apps with minimal effort, by providing a rich set of mobile platform and client development services that allow Mobile App Developers to focus on Design and Creativity. Mobile Cloud Service is agnostic to client development tools, provides integrated security and has features to measure & optimize customer engagement.
Oracle Mobile Cloud Service provides access to enterprise security features through Mobile Backend (MBE). Mobile Backend is a logical grouping of resources for an app or group of apps. Through basic auth and/or OAuth2.0., MBE provides the gateway for your app to access MCS assets. What this means is all the resources provided by MCS are secured by default, such as storage in collections, custom API endpoints, and more. Creating Mobile Backend is the step in configuring Oracle MCS for mobile app development. Lets go ahead and create MBE now.
Create Mobile Backend (MBE)
Firstly, login to MCS. Navigate to Mobile Backends (MBE).
A mobile backend is a secure grouping of APIs and other resources for a set of mobile apps. Within a mobile backend, you select the APIs that you want available for those apps.
Click on New Mobile Backend button.
The MBE Creation page appears. Fill in the required details and click on create button.
After creating the Backend, go to settings page of the MBE.
In this page, we can see Access Keys generated for this MBE.
HTTP Basic Authentication keys are generated for you in the form of a mobile backend ID and an anonymous key.
These keys are also unique by environment. When you deploy a mobile backend to a different environment, a new set of keys is generated for the copy of the mobile backend that is added to the target environment.
If you suspect that these credentials have been compromised (such as by an application handling them insecurely), click Refresh to replace the credentials with new ones or click Revoke to cancel the existing credentials without generating replacements.
Create Connectors
Now, Navigate to Connectors from the Menu.
Create a connector by clicking on New Connector.
Select REST from the dropdown.
The Connector Creation screen opens. Fill in the required fields. Enter REST Service URL in Remote URL Field. And hit create button.
Once, the Connector is created the following screen appears showing four steps.
The Below screen shows the General Configuration of Connector.
Navigate to Rules Page.
Create new rules to test this connector on clicking New Rule button.
Click on Add Parameter.
Select Header from the dropdown.
Add all the Headers, which we used in POSTMAN for testing the Service.
In the same page, we will have HTTP Methods, where we can select to which HTTP Verb the defined Rule should apply. In this case, we will select POST.
Here we are not using any security constraints as we are using external authentication, we directly move on to testing the connector.
In this page, select the HTTP Method for this connector as POST.
In the Body section, give the same payload as we gave in POSTMAN.
We need to select a backend in authentication session. Hit on Test Endpoint.
Hit on Test Endpoint.
We can see a Status Code 200, which is a Success.
And the same output is generated as in POSTMAN.
Once the connector starts working as expected, we need to create Custom API and place the API in MBE.
For more details, check out our end to end guide on creating Ionic mobile app using Oracle EBS & Oracle MCS
Permalink