NEMO-allauth


NameNEMO-allauth JSON
Version 1.12.1 PyPI version JSON
download
home_pagehttps://gitlab.com/nemo-community/atlantis-labs/nemo-allauth
SummaryInstall Allauth plugin for NEMO
upload_time2024-04-19 03:20:31
maintainerNone
docs_urlNone
authorAtlantis Labs LLC
requires_python>=3.8
licenseMIT
keywords nemo allauth
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ===============
NEMO Allauth
===============

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** 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``

2. in settings.py add to your INSTALLED_APPS:

 ``"django.contrib.sites",``

 ...

 ``"NEMO",``

 ``"NEMO_allauth",`` (**has to be between NEMO and 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/)

3. In settings.py add to your MIDDLEWARE:

 ``"allauth.account.middleware.AccountMiddleware"``

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

::

    SOCIALACCOUNT_PROVIDERS = {
        "openid_connect": {
            "APPS": [
                {
                    "provider_id": "keycloak",
                    "name": "Keycloak",
                    "client_id": "<insert-id>",
                    "secret": "<insert-secret>",
                    "settings": {
                        "server_url": "<insert-url>/realms/<insert-realm>/.well-known/openid-configuration",
                    },
                }
            ]
        }
        "google": {
            "APP": {
                "client_id": "<client_id>",
                "secret": "<secret>"
            }
        }
    }

5. in settings.py set authentication backend to:

 ``AUTHENTICATION_BACKENDS = ["allauth.account.auth_backends.AuthenticationBackend"]``

6. 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"``

7. 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 (don't add the http part of your domain).


Customizing emails
==================
You can customize the emails being sent (a list can be found `here <https://django-allauth.readthedocs.io/en/latest/advanced.html#sending-email>`_)

To do that, place the filename in your NEMO `media` folder, for example to customize the subject `account/email/email_confirmation_subject.txt`, place `email_confirmation_subject.txt` in your `media` folder.

For emails, to customize `account/email/email_confirmation_message.txt`, place `email_confirmation_message.txt` to your `media` folder.

Both `.html` and `.txt` can be used for email messages.


Options
=======
By default, this plugin will send email verification emails to newly created users or users whose email has been changed.
You can turn this off by setting:

    ``SEND_EMAIL_VERIFICATION_ON_USER_SAVE = False``

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

    ``TRUST_SUPERUSERS_EMAIL = False``

You also can add a extra ajax url to be called on logout (before logout redirect url) by using:

    ``AJAX_BEFORE_LOGOUT_URL = <URL>``

Although not recommended, unverified emails coming from a specific provider (who for some reason cannot guarantee the email is owned by the user) can be marked as verified by setting the following:

::

    SOCIALACCOUNT_PROVIDERS = {
        "microsoft": {
            "trust_emails": True,
            ...
        }
    }



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)

            

Raw data

            {
    "_id": null,
    "home_page": "https://gitlab.com/nemo-community/atlantis-labs/nemo-allauth",
    "name": "NEMO-allauth",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "NEMO, ALLAUTH",
    "author": "Atlantis Labs LLC",
    "author_email": "atlantis@atlantislabs.io",
    "download_url": null,
    "platform": null,
    "description": "===============\nNEMO Allauth\n===============\n\nNEMO plugin to add social account authentication support to your NEMO instance.\n\nThis plugin is a wrapper around the great django-allauth plugin, allowing you to setup any social login with NEMO effortlessly.\n\nFor more information on django-allauth please visit\nhttps://django-allauth.readthedocs.io/\n\nDescription\n============\nThis plugin\"s goal is to allow users to sign in to NEMO with their social accounts.\n\nDue to NEMO\"s usage in labs to control area access and tool access, it is not advised to allow users to automatically signup.\nFor that reason, allauth signup is disabled.\n\nThe flow and process of adding users and having them log in via social credentials is a bit different:\n\n1. New users can **only** be added from within NEMO itself.\n\n2. 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).\n\n3. The user\"s email address in NEMO needs to match the one provided by the social account.\n\nInstallation\n============\n1. install library\n\n ``pip install NEMO-allauth``\n\n2. in settings.py add to your INSTALLED_APPS:\n\n ``\"django.contrib.sites\",``\n\n ...\n\n ``\"NEMO\",``\n\n ``\"NEMO_allauth\",`` (**has to be between NEMO and allauth**)\n\n ``\"allauth\",``\n\n ``\"allauth.account\",``\n\n ``\"allauth.socialaccount\",``\n\nfollowed by the social account providers you'd like to use, for example:\n\n ``\"allauth.socialaccount.providers.keycloak\",``\n\n ``\"allauth.socialaccount.providers.google\",``\n\n(A complete list with more detailed information is available at https://django-allauth.readthedocs.io/)\n\n3. In settings.py add to your MIDDLEWARE:\n\n ``\"allauth.account.middleware.AccountMiddleware\"``\n\n4. for each provider, you can set its configuration in settings.py:\n\n::\n\n    SOCIALACCOUNT_PROVIDERS = {\n        \"openid_connect\": {\n            \"APPS\": [\n                {\n                    \"provider_id\": \"keycloak\",\n                    \"name\": \"Keycloak\",\n                    \"client_id\": \"<insert-id>\",\n                    \"secret\": \"<insert-secret>\",\n                    \"settings\": {\n                        \"server_url\": \"<insert-url>/realms/<insert-realm>/.well-known/openid-configuration\",\n                    },\n                }\n            ]\n        }\n        \"google\": {\n            \"APP\": {\n                \"client_id\": \"<client_id>\",\n                \"secret\": \"<secret>\"\n            }\n        }\n    }\n\n5. in settings.py set authentication backend to:\n\n ``AUTHENTICATION_BACKENDS = [\"allauth.account.auth_backends.AuthenticationBackend\"]``\n\n6. in settings.py, set django's login and logout URLs to:\n\n ``LOGIN_URL = \"account_login\"``\n\n ``LOGIN_REDIRECT_URL = \"landing\"``\n\n ``LOGOUT_REDIRECT_URL = \"account_logout\"``\n\nif you only support one social provider (google for example), you can bypass the login screen by setting:\n\n ``LOGIN_URL = \"google_login\"``\n\n7. add to context_processors:\n\n ``\"NEMO.context_processors.show_logout_button\",``\n\n\nPost Installation\n=================\n\n1. run:\n\n    ``python manage.py migrate``\n\n2. login to NEMO detailed administration and update the ``example.com`` site with the appropriate domain and display name (don't add the http part of your domain).\n\n\nCustomizing emails\n==================\nYou can customize the emails being sent (a list can be found `here <https://django-allauth.readthedocs.io/en/latest/advanced.html#sending-email>`_)\n\nTo do that, place the filename in your NEMO `media` folder, for example to customize the subject `account/email/email_confirmation_subject.txt`, place `email_confirmation_subject.txt` in your `media` folder.\n\nFor emails, to customize `account/email/email_confirmation_message.txt`, place `email_confirmation_message.txt` to your `media` folder.\n\nBoth `.html` and `.txt` can be used for email messages.\n\n\nOptions\n=======\nBy default, this plugin will send email verification emails to newly created users or users whose email has been changed.\nYou can turn this off by setting:\n\n    ``SEND_EMAIL_VERIFICATION_ON_USER_SAVE = False``\n\nBy default, superuser email are considered verified. You can change that by adding in your settings.py:\n\n    ``TRUST_SUPERUSERS_EMAIL = False``\n\nYou also can add a extra ajax url to be called on logout (before logout redirect url) by using:\n\n    ``AJAX_BEFORE_LOGOUT_URL = <URL>``\n\nAlthough not recommended, unverified emails coming from a specific provider (who for some reason cannot guarantee the email is owned by the user) can be marked as verified by setting the following:\n\n::\n\n    SOCIALACCOUNT_PROVIDERS = {\n        \"microsoft\": {\n            \"trust_emails\": True,\n            ...\n        }\n    }\n\n\n\nNEMO User admin\n===============\nIn the detailed administration section of NEMO, actions were added to the User table. After selecting one or more users:\n\n1. To send a verification email to the user's email address\n\n2. To mark the user's email address as verified (use at your own risk)\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Install Allauth plugin for NEMO",
    "version": "1.12.1",
    "project_urls": {
        "Homepage": "https://gitlab.com/nemo-community/atlantis-labs/nemo-allauth"
    },
    "split_keywords": [
        "nemo",
        " allauth"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6af23d5d0912ecf2e679336eda2a525069bd5aebf52ca5c1a925f1a1ae04053f",
                "md5": "c4661fc9544b055bc5228b7155acb2af",
                "sha256": "edb3bb5207dbc560660889eb7fb07318aef5928ca79ae18f49275f2490fc4d69"
            },
            "downloads": -1,
            "filename": "NEMO_allauth-1.12.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c4661fc9544b055bc5228b7155acb2af",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 14899,
            "upload_time": "2024-04-19T03:20:31",
            "upload_time_iso_8601": "2024-04-19T03:20:31.806675Z",
            "url": "https://files.pythonhosted.org/packages/6a/f2/3d5d0912ecf2e679336eda2a525069bd5aebf52ca5c1a925f1a1ae04053f/NEMO_allauth-1.12.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-19 03:20:31",
    "github": false,
    "gitlab": true,
    "bitbucket": false,
    "codeberg": false,
    "gitlab_user": "nemo-community",
    "gitlab_project": "atlantis-labs",
    "lcname": "nemo-allauth"
}
        
Elapsed time: 0.23334s