Skip to content

Implementing the Data Adapter Interface

Roman Strobl edited this page Mar 4, 2019 · 16 revisions

PowerAuth Web Flow Customization documentation has been moved to: https://developers.wultra.com/docs/current/powerauth-webflow-customization/Implementing-the-Data-Adapter-Interface

Please use the new developer portal to access documentation.


Data Adapter is used for connecting Web Flow to client backend systems. It allows to interact with backends for user authentication, SMS authorization, read additional data required for the operation as well as notify client backend about operation changes.

DataAdapter Interface

The interface methods are defined in the DataAdapter interface:

Customizing Data Adapter

Following steps are required for customization of Data Adapter.

1. Implement Interface Methods

Consider which of the following methods need to be implemented in your project:

  • authenticateUser (optional) - implementation is required in case any Web Flow operation needs to authenticate the user using a username/password login form
  • fetchUserDetail (required) - provides information about the user (user ID and name) for the OAuth 2.0 protocol
  • decorateFormData (optional) - implementation is required in case any Web Flow operation form data needs to be updated after authentication (e.g. add information about user bank accounts)
  • formDataChangedNotification (optional) - implementation is required in case the client backends need to be notified about user input during an operation
  • operationChangedNotification (optional) - implementation is required in case the client backends need to be notified about operation status changes
  • generateAuthorizationCode (optional) - implementation is required in case any Web Flow operation needs to authorize the user using SMS authorization
  • generateSMSText (optional) - implementation is required in case any Web Flow operation needs to authorize the user using SMS authorization
  • sendAuthorizationSMS (optional) - implementation is required in case any Web Flow operation needs to authorize the user using SMS authorization

2. Implement the DataAdapter Interface

Implement the actual changes in Data Adapter so that it connects to an actual data source.

  • Clone project powerauth-webflow-customization from GitHub.
  • Update the pom.xml to add any required additional dependencies.
  • Create a proprietary client (+ client config) for your web services.
  • Implement the Data Adapter interface by providing your own implementation in the DataAdapterService class. You can override the sample implementation.