Skip to content

Feature/single sign on

Marvin Wilke requested to merge featurs/single-sign-on into staging

Created by: MagdaN

How this can be tested:

In the project that is going to be the SERVER create a new Application in the django dashboard (admin/oauth2_provider/application/):

  1. add /accounts/wechange/login/callback/ to redirects
  2. Client type : Confidential
  3. Authorization grant type: Authorization code
  4. Skip authorization: checked

In the project that is going to be the CLIENT:

  1. add the following to your settings: COSINNUS_IS_OAUTH_CLIENT = True COSINNUS_OAUTH_SERVER_BASEURL = 'http://oauth-provider:8000' ACCOUNT_ADAPTER = 'cosinnus_oauth_client.views.CosinusAccountAdapter' ACCOUNT_EMAIL_REQUIRED = True SOCIALACCOUNT_ADAPTER = 'cosinnus_oauth_client.views.CosinusSocialAccountAdapter' SOCIALACCOUNT_AUTO_SIGNUP = False SOCIALACCOUNT_FORMS = {'signup': 'cosinnus_oauth_client.forms.SocialSignupProfileSettingsForm'} SOCIALACCOUNT_EMAIL_VERIFICATION = "none"

  2. add the following to urls.py:

if getattr(settings, 'IS_COSINNUS_OAUTH_CLIENT', False) and getattr(settings, 'COSINNUS_OAUTH_SERVER_BASEURL', False):

    from cosinnus_oauth_client.views import custom_connections
    from cosinnus_oauth_client.views import custom_password_set

    urlpatterns += [
        url(r'accounts/social/connections/$', custom_connections, name='socialaccount_connections'),
        url(r'accounts/password/set/', custom_password_set, name='account_set_password'),
        url(r'accounts/', include('allauth.urls')),
    ]
  1. Go to /admin/socialaccount/socialapp/add/ and add a new provider with the data from your Django OAuth Toolkit Application on the Oauth Server

Merge request reports