OHDSI / Broadsea

Broadsea deploys the core OHDSI technology stack (Atlas & R Hades), using cross-platform Docker container technology.
http://ohdsi.github.io/Broadsea/
Apache License 2.0
71 stars 54 forks source link

Add new .env parameter to allow basic (database) authentication to be enabled with the Broadsea ATLASDB demo database #126

Open leeevans opened 3 months ago

leeevans commented 3 months ago

The Broadsea ATLASDB demo database has a default webapi_security.security table to support basic (database) Atlas authentication. That table is pre-populated with an 'admin' user and an 'ohdsi' user.

The Broadsea .env file needs to expose a new parameter to allow an override of the default ATLAS basic authentication lookup SQL statement, so that the required security schema name and table name SQL statement can be defined.

The following changes are needed:

In the .env file, in the "basic security" section, add the following new variable (which has the correct value for ATLASDB):

SECURITY_DB_DATASOURCE_AUTHENTICATIONQUERY="select password from webapi_security.security where lower(email) = lower(?)"

In the ohdsi-webapi.yml file, in the "# Security env variables - Basic" section, add the below line to pass through the new .env variable:

SECURITY_DB_DATASOURCE_AUTHENTICATIONQUERY: ${SECURITY_DB_DATASOURCE_AUTHENTICATIONQUERY}

Also, set the other SECURITYDB prefixed .env parameters to default to the ATLASDB demo database