Giter Club home page Giter Club logo

conp-authentication's Introduction

CONP Authentication

This is the authentication application used by conp-portal login and authenticate users

Requirements

This code requires Python 3.7 and PostgreSQL 9.5

Python Virtual Environment

Create a Python virtual environment called venv and install Flask dependencies

python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

Database set up

After installing PostgreSQL there are a few steps needed to get your database set up.

  1. Run createdb conp-auth to create an empty database named 'conp-auth'.
  2. Tell the app how to find your database. If no settings are provided it will try to connect to a database on localhost named 'conp-auth'. If you need to override this you can set an environment variable named 'DATABASE_URL' to point to the URL, as shown in the example below
export DATABASE_URL="postgresql://[db_name:db_pass@][hostname]/database_name"
  1. Create the tables. This is done by running:
flask db upgrade

ORCID set up

To manage accounts using ORCID you have to first register your app. Instructions are here: https://support.orcid.org/hc/en-us/articles/360006897174 When setting your 'Redirect URIs' use: <your machine's hostname>:5000/callback/orcid

After this you need to take the 'Client ID' and 'Client secret' from the developer tools page and add them as two environment variables.

export OAUTH_ORCID_ID=<your-client-id>
export OAUTH_ORCID_SECRET=<your-client-secret>

Note: In order for ORCID to communicate with your development server the server needs to listen on address 0.0.0.0 instead of 127.0.0.1. The easiest way to do this is to run flask with:

./oauth_run.py

Run Application

You can run the application locally with

flask run

The application will be live on http://127.0.0.1:5000/

Deployment

This flask application is deployed on Heroku. More information will be available soon

conp-authentication's People

Contributors

desm1th avatar jbpoline avatar paiva avatar papillonmcgill avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

desm1th

conp-authentication's Issues

[Suggestion] Swap the position of ORCID and institutional login buttons

On the login page for the CONP website. Consider, swapping the positions of the auto-sign in methods(ORCID and Institution).

The reason is that, more people are associated with institutions relative to Orcid. For example, most undergraduate students don't have ORCID's but are interested in the data. Most people don't get ORCID's until the publish there first paper.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.