OpenRIMS-RPM - Installation Part 3
Google Authentication
The Pharmadex 2 uses OATH2[1] to allow authenticate using Google login. For each deployment, the Google Authentication should be configured separately.
The original Google guide is here. The application type is Web Application
https://developers.google.com/adwords/api/docs/guides/authentication
The process is cumbersome, thus below screens from the current configuration
After configuration it will be necessary to copy Client ID and Client secret to the application.properties
## OATH2
spring.security.oauth2.client.registration.google.client-id=client_id
spring.security.oauth2.client.registration.google.client-secret=client_secret
Install as a service
For Linux the official guide is here https://docs.spring.io/spring-boot/docs/current/reference/html/deployment.html#deployment.installing.nix-services.system-d
For Windows the official guide is here https://docs.spring.io/spring-boot/docs/current/reference/html/deployment.html#deployment.installing.windows-services
Examples of the configurations are in the binary distributive. The folders are “windows” and “Linux”.
Provide access from the Internet
To provide access from the Internet it will be a good idea to establish a proxy gateway like Nginx or Apache2. The example of virtual server configuration for Apache 2 is in the binary distributive, folder “Linux”.
IIS as a gateway for Spring Boot application
Redirect rules, URL rewrite module
Special configurations
https://serverfault.com/questions/936922/setting-up-iis-reverse-proxy-to-preserve-host-headers
Example of web.config for the default IIS site
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Reverse Proxy to www.pharmadexmz.org/mozambique" stopProcessing="true">
<match url="mozambique/.*" />
<conditions>
<add input="{HTTP_HOST}" pattern="^www.pharmadexmz.org$" />
</conditions>
<action type="Rewrite" url="http://localhost:8081/{R:0}" />
</rule>
<rule name="Reverse Proxy to www.pharmadexmz.org" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTP_HOST}" pattern="^www.pharmadexmz.org$" />
</conditions>
<action type="Rewrite" url="http://localhost:8081/mozambique/{R:0}" />
</rule>
<rule name="Reverse Proxy to pharmadexmz.org/mozambique" stopProcessing="true">
<match url="mozambique/.*" />
<conditions>
<add input="{HTTP_HOST}" pattern="^pharmadexmz.org$" />
</conditions>
<action type="Rewrite" url="http://localhost:8081/{R:0}" />
</rule>
<rule name="Reverse Proxy to pharmadexmz.org" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTP_HOST}" pattern="^pharmadexmz.org$" />
</conditions>
<action type="Rewrite" url="http://localhost:8081/mozambique/{R:0}" />
</rule>
<rule name="Reverse Proxy to eperm.pharmadexmz.org" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTP_HOST}" pattern="^eperm.pharmadexmz.org$" />
</conditions>
<action type="Rewrite" url="http://localhost:8082/{R:0}" />
</rule>
<rule name="Reverse Proxy to anarme.pharmadexmz.org" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTP_HOST}" pattern="^anarme.pharmadexmz.org$" />
</conditions>
<action type="Rewrite" url="http://localhost:8083/{R:0}" />
</rule>
<rule name="PViMS HTTP to HTTPS Redirect" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTPS}" pattern="^OFF$" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" appendQueryString="false" />
</rule>
</rules>
</rewrite>
<tracing>
<traceFailedRequests>
<add path="*">
<traceAreas>
<add provider="WWW Server" areas="Rewrite" verbosity="Verbose" />
</traceAreas>
<failureDefinitions timeTaken="00:00:00" statusCodes="404, 500" />
</add>
</traceFailedRequests>
</tracing>
</system.webServer>
</configuration>
[1] The theory is here https://developers.google.com/identity/protocols/oauth2 The Pharmadex 2 uses the web-server applications scenario.