Social Login


The social login feature is disabled by default.

In order to enable this feature you have to follow the setup instructions below and then activate it via global setting or from the admin interface.

Social login is supported by generating an additional temporary token right after users perform the social sign-in, the user is then redirected to the captive page with two querystring parameters: username and token.

The captive page must recognize these two parameters and automatically perform the submit action of the login form: username should obviously used for the username field, while token should be used for the password field.

The internal REST API of openwisp-radius will recognize the token and authorize the user.

This kind of implementation allows to implement the social login with any captive portal which already supports the RADIUS protocol because it’s totally transparent for it, that is, the captive portal doesn’t even know the user is signing-in with a social network.


If you’re building a public wifi service, we suggest to take a look at openwisp-wifi-login-pages, which is built to work with openwisp-radius.


Install django-allauth:

pip install django-allauth

Ensure your looks like the following (we will show how to configure of the facebook social provider):

    # ... other apps ..
    # apps needed for social login
    # showing facebook as an example
    # to configure social login with other social networks
    # refer to the django-allauth documentation


# showing facebook as an example
# to configure social login with other social networks
# refer to the django-allauth documentation
    'facebook': {
        'METHOD': 'oauth2',
        'SCOPE': ['email', 'public_profile'],
        'AUTH_PARAMS': {'auth_type': 'reauthenticate'},
        'INIT_PARAMS': {'cookie': True},
        'FIELDS': [
        'VERIFIED_EMAIL': True,

Ensure your main contains the allauth.urls:

urlpatterns = [
    # .. other urls ...
    path('accounts/', include('allauth.urls')),

Configure the social account application

Refer to the django-allauth documentation to find out how to complete the configuration of a sample facebook login app.

Captive page button example

Following the previous example configuration with facebook, in your captive page you will need an HTML button similar to the ones in the following examples.

This example needs the slug of the organization to assign the new user to the right organization:

<a href=""
   class="button">Log in with Facebook

Substitute, and default with the hostname of your openwisp-radius instance, your captive page and the organization slug respectively.

Alternatively, you can take a look at openwisp-wifi-login-pages, which provides buttons for Facebook, Google and Twitter by default.


See social login related settings.