ORCID middleware to enable our researchers to designate GW as a trusted partner
openssl req -new -x509 -days 3652 -nodes -out sp.crt -keyout sp.key
orcidflask/saml/certs
directory.orcidflask/saml
directory, create a settings.json
file to provide the metadata for your app and your identity provider, as well as the certificate from your identify provider. You can follow the example on the python3-saml repository or in example-settings.json
.SERVER_KEY
should be the key used to encrypt the Flask session objects, as described here.
cp example.config.py config.py
example.docker-compose.yml
to docker-compose.yml
and example.env
to .env
. docker-compose up -d
. This will install all necessary dependencies and launch the Flask app with gunicorn on port 8080
. For development, comment out the first three lines under the volumes
section of the flask-app
service and uncomment the line .:/opt/orcid_integration
. This will use the local copy of the Python code.example.env
). If the file is not present, it will create a new database encryption key. Be careful with this key. Once the data has been encrypted using it, the key is necessary to decrypt the data again. Loss of the key means loss of the data../data
directory.
./data
every time you start up the container, after starting the container the first time, modify the db
service in docker-compose.yml
to include the following line (where UID
and GID
are the system ID's of the user and group to which you want to assign ownership of the ./data
directory):
user: "UID:GID"
flask-app
container running, do the following:
docker exec -it orcid-integration_flask-app_1 /bin/bash
python generate_saml_metadata.xml
The SAML metadata file should be written to the orcidflask/saml
directory (bind-mounted outside the container).
sudo apt-get install nginx
cd /etc/nginx/sites-enabled
sudo rm default
server {
listen 80;
listen [::]:80;
server_name gworcid-dev.wrlc.org;
return 302 https://$server_name$request_uri;
}
server {
listen 443 ssl;
listen [::]:443 ssl;
ssl_certificate /etc/ssl/certs/server.crt;
ssl_certificate_key /etc/ssl/private/server.key;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header HOST $http_host;
proxy_pass http://127.0.0.1:8080;
proxy_redirect off;
}
}```
docker exec -it orcid-integration_flask-app_1 flask serialize-db ./data/token-dump.json