entersekt-customerauthn-plugin
Mobile icon

Entersekt CustomerAuthn Plugin

version 1.0.2 (Compatible with OutSystems 11)
Uploaded
 on 12 October 2021
 by 
ExoSystems
0.0
 (0 ratings)
entersekt-customerauthn-plugin

Entersekt CustomerAuthn Plugin

Documentation
1.0.2

How to setup CustomerAuthn Plugin

This plugin is based on the Entersekt CustomerAuthn Plugin from Entersekt. See https://www.entersekt.com/docs/customer-authn for documentation about plugin methods.

Head to Extensibility configurations and input the Username and Password that was provided to you by Entersekt. The plugin will not build without these credentials.
Once the credentials are in place publish the module and wait for MABS to build the plugin. Tested and working on MABS 7.1.



Using the plugin block and actions

  1. Configure and initialise the plugin. We recommend running theses actions in the OnApplicationReady action of you app.
    In the provided demo this is done asynchronously.
    Config and initialise can also be done synchronously but the app will stay on the loading splash until the SDK is ready.
  2. Set your Entersekt ChannelId and ServiceId in the ECAPlugin_SetConfig action
  3. Add the block to a screen and set the call-back action for OnChallengeCustomer callback. This is the first event triggered when requesting authentication



Demo Example - Biometric Authentication

To be able to send authentication requests you will need an endpointId. This can be found using ECAPlugin_GetSDKInfo action. In the provided demo, the endpointId can be found by tapping 'Get SDK Info'. The endpointId is unique to the device and will change whenever you re-install the app

  1. Using the reactive demo app for the Entersekt API's, enter your endpointId, generate a OAuth2 token and send a challengeCustomer Biometric request. (See the documentation for the API demo for the other needed credentials)
  2.  Once sent the OnChallengeCustomerCallback event will trigger in the block. In our demo this opens a popup with the buttons and text sent by the ChallengeAnswer Structure and is mapped as seen below:

    All authentication requests will always first trigger the OnChallengeCustomerCallback event

  3. ECAPlugin_AnswerChallenge action takes the AnswerChallenge structure as input and is used to either accept (ButtonRole = 'POSITIVE') or reject (ButtonRole = NEGATIVE') the authentication challenge

  4. Upon accepting the challenge, the OnRequireBiometricAuthFactorCallback will be fired. If this is the first time Biometric authentication has been requested by the app, OnSetBiometricAuthFactorCallback will fire first. In the handler of both these events the ECAPlugin_BiometricProceed action is used which will then ask the user to present their fingerprint (if supported by the device).



Final Notes on Authentication

All other callbacks will be triggered in exactly the same manner as the biometric example above i.e:

  1. OnChallengeCustomerCallback will fire
  2. The relevant callback for the request will fire based on the answer to the challenge
  3. Authentication is then complete

For detailed information about the actions and the SDK methods they are based off, see the CustomerAuthn Documentation here (Sign up and login required)



Push notifications as seen in the demo

The provided demo uses an implementation of outsystems-cordova-plugin-push (Modified version of cordova-plugin-push). Plugin can be found on the Forge here Cordova Push Plugin

The plugin makes use of ECAPlugin_SetPushConfig & ECAPlugin_HandlePushMessage actions which are configured when the app is registered for push notifications on the Entersekt push notification service. Code on how to implemented it can be found in the demo in the initPushNotifications javascript node

Notifications are coded in JavaScript since the callbacks need to run ECAPlugin_SetPushConfig & ECAPlugin_HandlePushMessage actions. For more information see the PushNotification.init(), .on('notification') and .on('register') methods found in the documentation here.


Local notifications as seen in the demo

Local notifications are implemented using the Local Notifications Plugin found on the Forge. Also makes use of the Mobile Events Forge component to detect if the app is in the background.

 Local notifications are send in the OnChallengeCustomer callback of the block

The action first checks if the app is in the background using the Mobile Events blocks that sets the IsPaused variable

Notification is then sent if the app is in the background.