Using an entitlement service, Experience Manager Mobile Runtimes can support user login and grant access (entitle) to certain collections based on the sign-in credentials.
This README provides a quick usage guide to the example entitlement server. For full walkthrough, please refer to the following help article: Set up an entitlement service.
This entitlement service now supports the use of Google or Facebook as the Identity Service provider. To do so, update the $identity_provider value in Configuration to either Google or Facebook. In addition, there is the generic identity provider. To use the generic identity provider, leave the $identity_provider value as is. Please refer to the following help article on use custom authentication in AEM Mobile apps.
NOTE: The example implementation is to be provided as is, Adobe will not provide support on the code, the implementation, or the deployment process. If you have questions about the implementation, please refer to the AEM Mobile forum.
- A server with MySQL and PHP installed.
- A MySQL user account from the server.
- An AEM Mobile user account
- Prerequisite Knowledge: Basic understanding of MySQL and PHP
- Navigate to the phpMyAdmin page on the server with MySQL and PHP installed
- If prompted to log in, enter the database username and password.
- Navigate to the page to create new database in the MySQL database, by clicking either the
New
option on the left sidebar or thedatabase
tab on the top navigation bar. - Enter the database name entitlement_admin (preferably), or a name of your choice, into the
Database name
field on the page. - Generate the new database with name entitlement_admin, or the name you entered in step 3, by clicking the
Create
button on the right. - Select the new database by clicking the new database name in the list.
- Navigate to the import page to import the necessary database structure, by clicking the
Import
tab on the top navigation bar. - Open the browse window to select the existing database (.sql) by clicking the
Choose File
option. - Select the existing database file from the new window, entitlement_admin.sql, and click the
Choose
button to confirm. - Upload the selected database (.sql) by clicking on the
Go
button. - If the database was successfully created, there will be a message similar to the following: Import has been successfully finished.
- Open the file
settings.php
with an text editor, located in the<source-code>/php/settings.php
, and update the values for the following parameters:- $db_host, set this to the MySQL host name
- $db_user, set this to the MySQL account user name, default is root
- $db_password, set this to the MySQL account password, default is root
- $db_name, set this to the MySQL database name, created in step 3 of MySQL installation process.
- $admin_list, set this with the list of administrative users with access to the entitlement server.
- $identity_provider, set this with the identity provider name: default, google, or facebook.
- Upload all the source code to the root directory of a server with MySQL and PHP installed.
- Navigate to the index.html page from the server to see the login screen.
This example entitlement server supports the usage of Google, Facebook, or Generic Identity Provider. When using Google or Facebook, the AEM Mobile Runtime will provide the authToken
in the Entitlement V2 API: /entitlements. When using Generic Identity Provider, the Runtime will redirect users to the provided custom sign in UI.
Since there is not a clear way (100%) of telling apart if the authentication token is from Google or Facebook, you will need to set the $identity_provider to either "google" or "facebook", respectively. This value can be found in <source-code>/php/settings.php
.
The generic identity provider can be found in <source-code>/idp
directory. From the domain that this example entitlement server will be hosted in, the authentication URL would be as follows:
http://<domain>/<path-to-source-code>/idp/index.html