Metadata-Version: 2.1
Name: dc_auth
Version: 1.3.1
Summary: The Data Central authentication django app
Home-page: https://datacentral.org
Author: Liz Mannering
Author-email: elizabeth.mannering@mq.edu.au
License: BSD
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Framework :: Pytest
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
License-File: LICENSE
Requires-Dist: Django>=2.1.2
Requires-Dist: django-settings-export>=1.2.1
Requires-Dist: django-cas-ng>=3.6.0
Requires-Dist: django-cookie-law>=2.0.3
Requires-Dist: django-extensions>=2.2.8
Requires-Dist: pytest
Requires-Dist: pytest-django
Requires-Dist: hypothesis[django]
Requires-Dist: Faker>=0.9.2
Requires-Dist: factory-boy>=2.11.1
Requires-Dist: pytz

=======
dc-auth
=======

dc-auth is a dedicated Django app to connect the Data Central authentication
backend (LDAP) to multiple dc sites (api, cms etc) via CAS.
It supports session-based authentication (tested) and JWT authentication
(untested).

For users outside of Data Central, you'll need to send us details about your
application in order to be able to connect, please contact us at
https://jira.aao.org.au/servicedesk/customer/portal/3.


Quick start
-----------
Add "dc_auth" + the following apps to your INSTALLED_APPS setting like this::

    INSTALLED_APPS = [
        'rest_framework',
        'rest_framework.authtoken',
        'rest_auth',
        ...
        'dc_auth',
    ]

Add django_settings_export.settings_export to your project's
context_processors::

    'OPTIONS': {
        'context_processors': [
            'django.template.context_processors.debug',
            'django.template.context_processors.request',
            'django.contrib.auth.context_processors.auth',
            'django.contrib.messages.context_processors.messages',
            'django_settings_export.settings_export',                   # <----
        ],
    },

Include the dc_auth URLconf in your project urls.py like this::

    path('auth/', include('dc_auth.urls')),

Migrate to create the Profile table. Run `python manage.py migrate`.

Start the development server and visit http://127.0.0.1:8000/auth/login to log
into your account.

Tests
-----

From the top-level directory run:

.. code-block::

    $ tox

dcauth comes with some helpers that tools building on dcauth can use,
specifically pytest fixtures for affiliation (`affiliation`) and test passwords
(`secure_password`), as well as factories and fixtures for the `User` and
`Profile` classes.

Installing for internal applications
------------------------------------

To install into another Data Central project, add `dc_auth` to your requirements
file (lock to a specific version), and ensure that pip is pointed to the DC
devpi instance.


Contributing
------------

For local development (within a virtualenv), run the following to get a django
test web server (`dc_auth.settings_testing` is for running the tests, but should
be fine for interactive use).

.. code-block::

    $ export DJANGO_SETTINGS_MODULE=dc_auth.settings_testing
    $ pip install -e .
    $ python -m django runserver
