-
Notifications
You must be signed in to change notification settings - Fork 1
Implementing the Data Adapter Interface
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.
The interface methods are defined in the DataAdapter interface:
- authenticateUser - perform user authentication with remote backend based on provided credentials
- fetchUserDetail - retrieve user details for given user ID
- decorateFormData - retrieve operation form data and decorate it
- formDataChangedNotification - method is called when operation form data changes to allow notification of client backends
- operationChangedNotification - method is called when operation status changes to allow notification of client backends
- generateAuthorizationCode - generate authorization code for authorization SMS message
- generateSMSText - generate SMS text for authorization SMS message
- sendAuthorizationSMS - send authorization SMS message
Following steps are required for customization of Data Adapter.
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
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.