Compilation, Packaging and Deployment
Web Flow uses Maven for compilation and packaging. Java 8 should be used to compile Web Flow.
Web Flow can be deployed to any Java web container (such as Tomcat) using war artifacts produced during compilation.
In order to build Web Flow using Maven, following PowerAuth dependencies need to be satisfied:
- powerauth-push-server - dependency powerauth-push-client
- powerauth-restful-integration - dependency powerauth-restful-security-spring
- powerauth-crypto - dependency powerauth-java-crypto
- lime-java-core - dependency rest-model-base
These projects should be installed into local Maven repository using the “install” goal before building Web Flow. This step may not be necessary in case these packages are already published in the public repository in their required versions.
Other dependencies are resolved automatically by Maven by downloading packages from public Maven repositories.
Building Web Flow
Web Flow can be built using the parent pom.xml file of project powerauth-webflow. Use the “package” goal to generate the war artifacts. The war files will be built in target subfolders of project folders. In case the compilation fails, check for missing PowerAuth dependencies to be installed.
Once you create a war package using steps above and set up database for Web Flow, you can deploy the war files to any Java web container, such as Tomcat or any Java EE server. You can remove the version from the war file for a nicer target URL in the container (e.g. rename powerauth-webflow-0.0.xx-SNAPSHOT.war to powerauth-webflow.war). After deployment, the client application frontend should be available at http[s]://host:port/powerauth-webflow-client.
The following war files need to be deployed for a fully functional demo of Web Flow:
- powerauth-webflow.war - the main Web Flow application
- powerauth-nextstep.war - the Next Step service
- powerauth-data-adapter.war - a Data Adapter for communication with client backends
- powerauth-webflow-client.war - demo client application
The whole installation process is described in the Web Flow Installation Manual.
Testing Web Flow
You can test the web flow demo application by navigating to: http://localhost:8080/powerauth-webflow-client
- Use the “Login” action to test the user authentication. The Credential Server Sample project uses “test” as password for any username.
- Use the “Payment (DEMO)” action to test payment authorization. You will need to enable POWERAUTH_TOKEN authentication method for the user who will authorize the payment (using Next Step REST API).
- Use the “Authorization” action to test operation authorization. In order to test this action you will need to create an operation and obtain its operationId (using Next Step REST API).
Maven Profiles (Advanced)
There are following Maven profiles defined:
- prod - used for deployment to a production environment (default profile)
- fast - used for fast redeployment to a development environment (do not use when dependencies change, in this case prod build is required)
- dev - used for development in the IDE (mainly for debugging)
Path to the pom.xml file:
During development you can start the backend and the frontend separately for easier continuous redeployment.
To start the backend part in the IDE, simply point the IDE to run Main class:
You should see a Spring boot console in IDE log and the last message should start with “Started PowerAuthWebFlowApplication”. To redeploy, trigger a build in the IDE and Maven should redeploy changes automatically.
To start the frontend part in the IDE, use the package phase with the “dev” Maven profile:
mvn package -P dev