Skip to content

Deploying Push Server

Petr Dvorak edited this page Nov 16, 2016 · 21 revisions

Push Server is a Java EE application (packaged as an executable WAR file) that can be used to send push notifications to iOS or Android devices. This chapter explains what steps need to be taken in order to deploy PowerAuth 2.0 Push Server.

Downloading Push Server

You can download the latest powerauth-push-server.war at the releases page:

Configuring Push Server

The default implementation of a PowerAuth 2.0 Push Server has only one compulsory configuration parameter powerauth.service.url that configures the SOAP endpoint location of a PowerAuth 2.0 Server. The default value for this property points to localhost:

powerauth.service.url=http://localhost:8080/powerauth-java-server/soap

Setting Up Credentials

(optional) In case PowerAuth 2.0 Server uses a restricted access flag in the server configuration, you need to configure credentials for the PowerAuth 2.0 Push Server so that it can connect to the SOAP service:

powerauth.service.security.clientToken=
powerauth.service.security.clientSecret=

The credentials are stored in the pa_integration table.

Note: For SOAP interface, PowerAuth 2.0 Server uses WS-Security, UsernameToken validation (plain text password). The RESTful interface is secured using Basic HTTP Authentication (pre-emptive).

Connecting to Database

The default database connectivity parameters in powerauth-push-server.war are following (MySQL defaults):

spring.datasource.url=jdbc:mysql://localhost:3306/powerauth
spring.datasource.username=powerauth
spring.datasource.password=
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.jpa.hibernate.ddl-auto=none

These parameters are of course only for the testing purposes, they are not suitable for production environment. They should be overridden for your production environment using a standard Spring database connectivity related properties.

As you can see, these credentials are the same as for the PowerAuth 2.0 Server. You may use the same database for both applications but it is not required - Push Server can have own database.

Setting Up Database Tables

The PowerAuth 2.0 Push Server requires several new tables to be set up - refer to the separate documentation for the detailed description of these tables:

The new tables may or may not reside in the same database that you use for your PowerAuth 2.0 deployment.

Setting up APNL

PowerAuth 2.0 Push Server uses Pushy to send notifications. Since Pushy uses the new HTTP/2 interface for sending APNs messages, underlying server must support this protocol. As a result, Java runtime / application container must support HTTP/2 as well.

APNL and Tomcat 8.0

Put apnl-boot library in ${CATALINA_HOME}/lib folder and make sure to start Tomcat with -Xbootclasspath/p:${CATALINA_HOME}/lib/alpn-boot.jar parameters, so that the library is on classpath.

Deploying Push Server

You can deploy PowerAuth 2.0 Push Server into any Java EE container.

The default configuration works best with Apache Tomcat server running on default port 8080. In this case, the deployed server is accessible on http://localhost:8080/powerauth-push-server/.

To deploy PowerAuth 2.0 Push Server to Apache Tomcat, simply copy the WAR file in your webapps folder or deploy it using the "Tomcat Web Application Manager" application (usually deployed on default Tomcat address http://localhost:8080/manager).

Important note: Since PowerAuth 2.0 Push Server is a very simple application with direct access to the PowerAuth 2.0 Server SOAP services, it must not be under any circumstances published publicly and must be constrained to the in-house closed infrastructure. The only exception to this rule is the requirement to open up ports for the purpose of communication with APNs and FCM services - the push notifications apparently would not work without access to the primary push service providers.

Deploying Push Server Outside the Container

You can also execute WAR file directly using the following command:

java -jar powerauth-push-server.war

Note: You can overwrite the port using -Dserver.port=8090 parameter to avoid port conflicts.

Important note: Since PowerAuth 2.0 Push Server is a very simple application with direct access to the PowerAuth 2.0 Server SOAP services, it must not be under any circumstances published publicly and must be constrained to the in-house closed infrastructure. The only exception to this rule is the requirement to open up ports for the purpose of communication with APNs and FCM services - the push notifications apparently would not work without access to the primary push service providers.