Skip to content

HumanBrainProject/collaboratory_app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Collaboratory App Example

Up and running

Install your environment

virtualenv venv
. venv/bin/activate
pip install -r requirements.txt

Trust SSL certificate

You also need to trust the SSL certificate in ssl/localhost.crt. Even better is to replace it with your own. The procedure for generating a self-signed certificate is readily available on-line.

Create a new HBP OpenID Connect client

The OpenID Connect Client Manager can be found in the Collaboratory at this url:

https://collab.humanbrainproject.eu/#/collab/54/nav/1051

When configuring you test client.

  1. Pick a meaningful name (probably something related to your App name)
  2. Select 'Server flow' application type
  3. Add to 'Authorized redirect URL' a local testing url: https://localhost:8000/complete/hbp/
  4. Ensure that the scopes hbp.collab, hbp.document and hbp.notification.self are checked.
  5. Save your client registration

Save the "Client ID" and "Client Secret" values for the next step.

Define your environment

Copy .env-sample to .env

Replace SECRET_KEY with the output of the following command:

OSX:

date | md5

Linux or Cygwin:

date | md5sum

Replace HBP_OIDC_CLIENT* with the data collected from the OpenID Connect Client Manager in the previous step.

cp .env-sample .env

Create the database

You can now run the migration in order to bootstrap the database.

python manage.py migrate

Start the server

You can then start the server

python manage.py runsslserver --certificate=ssl/localhost.crt --key=ssl/localhost.key

Start the server

From another terminal open an example URL to test your new app:

OSX:

open https://localhost:8000?ctx=2BB5C05D-C417-4ED7-8D4D-C4F940DA8328

Linux:

xdg-open https://localhost:8000?ctx=2BB5C05D-C417-4ED7-8D4D-C4F940DA8328