||4 years ago|
|django_eve||4 years ago|
|django_eve_sso||4 years ago|
|example_app||4 years ago|
|.gitignore||4 years ago|
|manage.py||4 years ago|
|readme.md||4 years ago|
|test.sh||4 years ago|
Django Eve SSO
This repo contains a quick way to start on Eve SSO projects using the Django framework.
- Simple setup for SSO - just plug in your client_id and secret
- Multiple roles - A user can select which role best fits them
How to setup
The actual tool is in the django_eve_sso folder, assume all filenames in this section are in that folder unless otherwise noted.
Copy django_eve_sso into your django project
Rename settings.example.py to settings.py, in that file are descriptions for settings you might want to set.
In your main django settings ([project name]/settings.py) add "django_eve_sso" to the INSTALLED_APPS array
Install required applications with
pip install -r requirements.txt
Make and run migrations:
python manage.py makemigrations python manage.py migrate
- In the admin site (probably [your url]/admin) add roles:
- Name: choose a name for your role, it should be short but descriptive
- Description html: This is where you can write a longer description of the role, it supports full HTML
- Scopes: Space seperated scopes that this role will ask for
- Sort order: The order which the scopes appear in the list with lower numbers being shown first (No, this isn't a GotG reference)
How to use
The provided example app shows a little bit how to use it but basically if you import the "Token" model from django_eve_sso you can use
Token.active_token which will return the currently logged in token or
None if there isn't one. From that you can get all the information you might need for doing ESI calls.
Bonus: If you use EsiPysi (wink wink) you can get an EsiAuth object right from the token