Tuesday, 27 September 2016

AEMM: How to create custom authentication


There are cases where we need to use custom login screen other than the login UI provided by AEMM. In such cases we need to use generic auth method in AEMM with custom UI hosted in our own server. Below given the approach.

We need to have our own API authentication mechanism running to achieve the functionality. In this case our system exposes an API which gives status as success or failure while authenticating in JSON format



Step 1:
Create a login form which accepts user credentials

<form onsubmit="loginfunctioncall();"> 
Username: <input type="text" /> 
Password: <input type="text" /> 
<input type="submit" /> </form>

Step 2:
Add a post method which takes the response and  collects user info. This info is processed to respective format as our API requires.
Do a post call and get response
Process the response(JSON format) back from POST and check the authentication is success
If authentication is success, redirect the user to app home screen, else alert user with an error message


<script>
function login() {

//process response and if authentication is success, set the success to true
var success = true;
var authToken = 'AUTH_TOKEN_BASED_ON_USER_LOGIN';
if (success && authToken) {
window.location = appData.redirectUri + '?authToken=' + authToken;  } else {
window.location = appData.redirectUri + '?error="Internal Error"';  } }
</script>

AEM Mobile Integration with third party application for authoring

There are cases where we need to create third party web portals to use for authoring instead of using AEMM authoring. Advantage of using such system is to isolate authoring from AEMM environment. To setup an independent suthoring, AEM Mobile supports API services. Below are the steps involved.



Web portal will be created in any language which will have its own database for holders for authoring AEMM content.
AEMM master admin should create an AEMM user with content creation access permissions.
We need to have AEM Mobile API access obtained from Adobe. (See section: 'Requesting an API key' https://helpx.adobe.com/digital-publishing-solution/help/integrating-dps.html)
webportal helps to upload AEM Mobile page content once logged in, and on submission it creates .article files with its manifest file using On Demand API. This creates html file through its service.To generate the article files from a folder, you can either use the desktop utility or use the example packager in ‘class/manifest.php’.
On-demand api push this article to aemm using created aemm content creation access id. To script the export process, you can use the ‘exportDpsArticle’ function. For details, see Creating InDesign-based articles using scripting.(https://helpx.adobe.com/content/help/en/digital-publishing-solution/help/export-indesign-articles-scripting.html)

Sunday, 18 September 2016

AEM Mobile Overview

Adobe Experience Manager Mobile(AEM Mobile/ AEMM)

AEM Mobile:
Adobe PhoneGap was one of the finest solution for enterprise level organisations to create and manage mobile application quickly.
AEM Mobile is an evolution from phone gap which enables its users to produce, manage and maintain their mobile apps from centralised server.

Advantages:

  • Existing contents can be migrated easily to AEM Mobile
  • Cloud managed, so centralised
  • Simple to custom complex level apps
  • Real time app update notifications
  • Simple apps can be developed by non technical users
  • Installable on multi platforms
  • Highly extensible, which can be customised to any level with its article collection combination
  • Ease in content publishing
  • Easily integrated with Adobe Analytics
  • Personalised content distribution


Steps in AEMM app development includes

  1. Create app
  2. Integrate data
  3. Manage and publish app
  4. Measure the data usage


AEM Mobile Pre-flight APP

 This app allows user to test and preview AEM Mobile app and content on-device, before you publish it. This is a kind of testing sandbox which helps you ensure your content appears the way you wanted it when viewed on a device. Entire testing which includes, app navigation, browse pages, interactivity and authentication levels.

We are going to add more details on below topics for AEM Mobile
How to create custom authentication?
Third party Authoring for AEM Mobile
How entitlement can be done?

Subscribe this blog for more writeups on AEM Mobile development.