Test Mobile Application
In the previous section, you signed up for access as a Mobile Developer and gained credentials to access the Globex Mobile Gateway API. In this section you will complete Mobile App configuration and test this out
1. Access the Mobile App
As part of this workshop, you will use a mobile-friendly Angular App and not a mobile-native app. So no mobile app installation is necessary. This Mobile App is work in progress and at present shows only categories and products within each category.
-
The Mobile Application can be access via this QR Code as well as via browser
-
Scan the following QR Code with your mobile phone and login using
asilva/openshift
-
Alternatively, launch Globex Mobile and login using
asilva/openshift
-
The login process may take a few seconds. Please wait for a bit :)
Figure 1. User is logged in -
After logging in, click on the View the categories button. You will view on a list of Categories available
Figure 2. Categories view -
Click on the 'Clothing' category to view the Product Listing.
-
Try out a few more categories too which will help us to generate some traffic to view in the Analytics section.
2. Analytics
-
Navigate to the {globex_developer_portal}/buyer/stats[Globex Developer Portal Statistics^, window="devportal"]
-
From the dropdown indicated in this screenshot, choose the Mobile Gateway API’s application plan (which is
basic-plan
in this case). -
You will be presented with the statistics graph of the calls made to this gateway by the Partner Developer’s access.
3. Under the hood
As part of this Section you tried out the Mobile App.
-
The user asilva you logged into the Mobile App as, is authenticated using Keycloak.
-
Once the user logs in, a token is generated by Keycloak using the Client ID, Keycloak Authority details that you passed to the Mobile App to setup the configuration
-
This token is authenticated by 3scale to ensure the Client ID indeed has access to that particular API
-
The token is also passed onto the backend service running on OpenShift, which checks for validity of the token.
-
The REST endpoints is supplied with the Keycloak URL information as part of the application.properties
-
The endpoints are protected with @Authenticated which in this case looks for a valid token being present.
Figure 3. REST endpoint is annotated with @Authenticated
With that we wrap up the activities Design, Govern, Manage, Secure Globex Mobile Gateway APIs for access from the Mobile Application securely.
Coming up next: We will setup the Globex Partner APIs for access by external Partner portals.
If you are running out time, now is a good time to switch to a different module. The Partner Portal section is quite similar to the Mobile App but for the fact that the Partner Users are not managed by Keycloak. Therefore Partner Portal authenticates itself using the Client Credentials method using a client ID and secret. The authentication is only through the backend services of the Partner Portal without users getting into the picture. |
4. Wrap up
You can now close all the tabs except for this Instructions and Dev Spaces browser tabs. Close all files open within Dev Spaces as well.
If you choose to proceed to another module, close all but this Instructions browser before starting the next module. Go back to the Workshop Deployer to choose your next module.