Skip to content

Polytechnique.org Authentication / Authorization provider

License

Notifications You must be signed in to change notification settings

Polytechnique-org/xorgauth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ee20c7c · Feb 17, 2025
Oct 26, 2023
Nov 25, 2023
Dec 30, 2017
Feb 17, 2025
Jul 2, 2017
Oct 27, 2023
Jun 30, 2019
Jul 2, 2017
Jan 1, 2018
Apr 3, 2018
Jan 13, 2019
May 5, 2019
Jul 2, 2017
Jul 2, 2017
May 19, 2019
Apr 27, 2019

Repository files navigation

xorgauth

https://secure.travis-ci.org/Polytechnique-org/xorgauth.png?branch=master Latest Version Supported Python versions Wheel status License

xorgauth handles authentication / authorization for Polytechnique.org-related services.

Note

This is currently a work in progress.

Features (planned)

  • Login with any alumni email address
  • OpenID Connect v1.0 provider
  • Legacy auth-groupe-x authentication provider
  • Multiple authentication levels (cookie, password, two-factor)

Configuring a development environment

Run the following commands in order to setup a development environment on a local computer:

make update
make createdb
make
python manage.py createsuperuser --fullname me --hrid me --preferred_name me --main_email me@localhost.localdomain
python manage.py importaccounts scripts/dev_data.json
python manage.py importauthgroupex scripts/dev_data.json
python manage.py runserver
# Go to http://127.0.0.1:8000/admin/ to configure django-oidc-provider

In such a development environment, in order to use the test relying party:

  • run python manage.py shell and add a client:

    from oidc_provider.models import Client, ResponseType
    c = Client(name='Test RP', client_id='123456', redirect_uris=['http://localhost:8000/test-relying-party/','http://127.0.0.1:8000/test-relying-party/'])
    c.save()
    c.response_types.add(ResponseType.objects.get(value='id_token token'))
  • run python manage.py runserver 8000

  • open http://localhost:8000/test-relying-party/ in a web browser and click on the log in button

Configuring a production environment

On Debian, configure a web server (Apache, ngninx, etc.) to serve Django applications (using uwsgi, mod_wsgi, etc.) by reading the documents relevant to these systems. It is a good idea to use a dedicated Python virtual environment.

In order to configure the production application, copy example_settings.ini to local_settings.ini and edit this new file accordingly (DNS hostname, admin email address, database credentials, etc.). It is also possible to use environment variables to give some settings to the Django application (thanks to getconf). It is then possible to initialize the database with:

make createdb

Here are instructions specific to xorgauth application for upgrading:

make update
python manage.py migrate
python manage.py collectstatic
# Recompile the translation files
make

Notes

About

Polytechnique.org Authentication / Authorization provider

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages