Default Configuration

The authentication settings for ShipWithDjango are highly configurable, allowing you to control user registrations and enable or disable third-party logins with ease. These settings are managed through the CONFIG/authentication.py file, where you can adjust the configuration to suit your project’s needs.

Here’s a breakdown of the default configuration and how you can customize it:

ALLOW_REGISTRATIONS = True

# Third-party login
# Global setting. If this is disabled, all third-party login will be disabled.
# This setting needs to be set to True to enable ANY individual third-party login.
ALLOW_THIRD_PARTY_LOGIN = False

# LinkedIn
ALLOW_LINKED_IN_LOGIN = False
LINKED_IN_CLIENT_ID = None
LINKED_IN_CLIENT_SECRET = None

# Github
ALLOW_GITHUB_LOGIN = False
GITHUB_CLIENT_ID = None
GITHUB_CLIENT_SECRET = None

Registrations

The ALLOW_REGISTRATIONS setting controls whether new users can sign up for your application. If you set ALLOW_REGISTRATIONS to False, the signup page will be blocked, preventing any new registrations. This can be useful for maintaining a closed or invite-only platform.

Third-Party Logins

ShipWithDjango supports third-party logins through GitHub and LinkedIn, offering your users a convenient way to authenticate using their existing accounts.

Enabling Third-Party Logins

To enable third-party logins, you first need to set ALLOW_THIRD_PARTY_LOGIN to True. This global setting must be enabled for any individual third-party login (such as GitHub or LinkedIn) to function. If this is set to False, no third-party login options will be available, even if they are individually configured.

Github

If you want to enable GitHub, you can do so by setting the ALLOW_GITHUB_LOGIN to True. Before you can integrate with GitHub, you will need to create an application in GitHub that can be used to authenticate with. Find out more here.

LinkedIn

If you want to enable LinkedIn, you can do so by setting the ALLOW_LINKED_IN_LOGIN to True. Before you can integrate with LinkedIn, you will need to create an application in LinkedIn that can be used to authenticate with. Find out more here.

Last updated