Skip to main content

Install Allauth plugin for NEMO

Project description

NEMO plugin to add social account authentication support to your NEMO instance.

This plugin is a wrapper around the great django-allauth plugin, allowing you to setup any social login with NEMO effortlessly.

For more information on django-allauth please visit https://django-allauth.readthedocs.io/

Description

This plugin’s goal is to allow users to sign in to NEMO with their social accounts.

Due to NEMO’s usage in labs to control area access and tool access, it is not advised to allow users to automatically signup. For that reason, allauth signup is disabled.

The flow and process of adding users and having them log in via social credentials is a bit different:

  1. New users can only to be be added from within NEMO itself.

  2. The user’s email will be used to login and needs to be verified both in NEMO and by the social account provider (most do).

  3. The user’s email address in NEMO needs to match the one provided by the social account.

Installation

  1. install library

pip install NEMO-allauth

  1. in settings.py add to your INSTALLED_APPS:

'django.contrib.sites',

'NEMO_allauth', (has to be before allauth)

'allauth',

'allauth.account',

'allauth.socialaccount',

followed by the social account providers you’d like to use, for example:

'allauth.socialaccount.providers.keycloak',

'allauth.socialaccount.providers.google',

(A complete list with more detailed information is available at https://django-allauth.readthedocs.io/)

  1. for each provider, you can set its configuration in settings.py:

SOCIALACCOUNT_PROVIDERS = {
    'keycloak': {
        'KEYCLOAK_URL': '<keycloak_url>/auth',
        'KEYCLOAK_REALM': '<keycloak_realm>',
        'APP': {
            'client_id': '<client_id>',
            'secret': '<secret>',
        }
    },
    'google': {
        'APP': {
            'client_id': '<client_id>',
            'secret': '<secret>'
        }
    }
}
  1. in settings.py set authentication backend to:

AUTHENTICATION_BACKENDS = ['allauth.account.auth_backends.AuthenticationBackend']

  1. in settings.py, set django’s login and logout URLs to:

LOGIN_URL = 'account_login'

LOGIN_REDIRECT_URL = 'landing'

LOGOUT_REDIRECT_URL = 'account_logout'

if you only support one social provider (google for example), you can bypass the login screen by setting:

LOGIN_URL = 'google_login'

  1. add to context_processors:

'NEMO.context_processors.show_logout_button',

Post Installation

  1. run:

    python manage.py migrate

  2. login to NEMO detailed administration and update the example.com site with the appropriate domain and display name

Options

By default, superuser email are considered verified. You can change that by adding in your settings.py:

TRUST_SUPERUSERS_EMAIL = False

NEMO User admin

In the detailed administration section of NEMO, actions were added to the User table. After selecting one or more users:

  1. To send a verification email to the user’s email address

  2. To mark the user’s email address as verified (use at your own risk)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

NEMO_allauth-1.0.0-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

Details for the file NEMO_allauth-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: NEMO_allauth-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 11.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.9.0

File hashes

Hashes for NEMO_allauth-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 df9ca0aa06e94027f2f6145074d162d1d59442adb7a08a5a37235fd05757c24d
MD5 c32d9be26ff3e4fc959ff0837e29a852
BLAKE2b-256 cbedb568f0661f51dec51dd049c1d96ffe879603fad22789d15a63e8ba62afe9

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page