A custom API Server Plugin must use a specific interface which precludes sending an additional parameter in a method call or returning an additional result from a method. However, Digipass S3 allows you to store additional, custom fields inside the sessionData object. Use this mechanism to pass data between your application and your custom API Server Plugin.
Pass information from the application to the server
Your application may need to send additional information to your custom API Server plugin. For example, your application may need to send the user's email or phone number to your Session plugin. To send data from your application to any custom API Server plugin, store additional fields in the sessionData object before sending it as a parameter to an App SDK method like getAuthenticationFragment(). The App SDK method then calls your API Server plugin with the sessionData object inside the jsonRequest parameter.
For example, when the Server calls the onVerifyRequest() method in your custom Session plugin, the jsonRequest.sessionData parameter of onVerifyRequest() contains those additional fields so your custom plugin can use them. The following table shows which method in each custom API Server plugin receives the sessionData that may contain additional fields.
Custom API server plugin | Plugin method that receives sessionData inside its jsonRequest parameter |
|---|---|
Session | |
External Authentication | |
Policy | |
Transaction | |
Pass information from the server to the application
Your custom API Server plugin may need to send additional information to your application. You can send additional information to your application from a Session Plugin, a Transaction Plugin, or an External Authentication Plugin.
To send data from your custom API Server plugin to your application, the onResponse(), onAuthenticated(), or finishTransaction() method in your custom API Server plugin stores additional fields in the jsonResponse.sessionData parameter. The App SDK collects these additional fields in a separate object after each request to the API Server. When the operation is complete, the App SDK then returns the object to your application in AdaptiveResult.sessionData. The following table shows which method in each custom API Server plugin can store additional fields in the sessionData object in order to send that information to the application.
Custom API server plugin | Plugin method that can store information inside sessionData for passing to the application |
|---|---|
Session | |
External Authentication | |
Transaction | |