Commit 82fc1b5d by Clinton Blackburn Committed by GitHub

Added support for single sign-out (#133)

ECOM-2345
parent b2f05bab
......@@ -2,11 +2,11 @@
import logging
import uuid
from django.db import transaction, connection, DatabaseError
from django.http import JsonResponse
from django.conf import settings
from django.contrib.auth import get_user_model, login, authenticate
from django.db import transaction, connection, DatabaseError
from django.http import Http404
from django.http import JsonResponse
from django.shortcuts import redirect
from django.views.generic import View
......
......@@ -184,6 +184,7 @@ AUTO_AUTH_USERNAME_PREFIX = 'auto_auth_'
SOCIAL_AUTH_EDX_OIDC_KEY = 'replace-me'
SOCIAL_AUTH_EDX_OIDC_SECRET = 'replace-me'
SOCIAL_AUTH_EDX_OIDC_URL_ROOT = 'replace-me'
SOCIAL_AUTH_EDX_OIDC_LOGOUT_URL = 'replace-me'
SOCIAL_AUTH_EDX_OIDC_ID_TOKEN_DECRYPTION_KEY = SOCIAL_AUTH_EDX_OIDC_SECRET
# Request the user's permissions in the ID token
......@@ -328,7 +329,3 @@ ECOMMERCE_API_URL = 'http://127.0.0.1:8002/api/v2/'
ORGANIZATIONS_API_URL = 'http://127.0.0.1:8000/api/organizations/v0/'
MARKETING_API_URL = 'http://example.org/api/catalog/v2/'
MARKETING_URL_ROOT = 'http://example.org/'
EDX_DRF_EXTENSIONS = {
'OAUTH2_USER_INFO_URL': 'http://localhost:8000/oauth2/user_info',
}
......@@ -15,32 +15,24 @@ Including another URLconf
import os
from auth_backends.urls import auth_urlpatterns
from django.conf import settings
from django.conf.urls import include, url
from django.contrib import admin
from django.contrib.auth.views import logout
from django.core.urlresolvers import reverse_lazy
from django.views.generic import RedirectView
from course_discovery.apps.core import views as core_views
from course_discovery.apps.course_metadata.views import QueryPreviewView
admin.autodiscover()
# pylint: disable=invalid-name
# Always login via edX OpenID Connect
login = RedirectView.as_view(url=reverse_lazy('social:begin', args=['edx-oidc']), permanent=False, query_string=True)
urlpatterns = [
urlpatterns = auth_urlpatterns + [
url(r'^admin/', include(admin.site.urls)),
url(r'^api/', include('course_discovery.apps.api.urls', namespace='api')),
url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')),
# Use the same auth views for all logins, including those originating from the browseable API.
url(r'^api-auth/', include(auth_urlpatterns, namespace='rest_framework')),
url(r'^api-docs/', include('rest_framework_swagger.urls')),
url(r'^auto_auth/$', core_views.AutoAuth.as_view(), name='auto_auth'),
url(r'^health/$', core_views.health, name='health'),
url(r'^login/$', login, name='login'),
url(r'^logout/$', logout, name='logout'),
url('', include('social.apps.django_app.urls', namespace='social')),
url('^$', QueryPreviewView.as_view()),
]
......
......@@ -12,7 +12,7 @@ djangorestframework-jwt==1.8.0
djangorestframework-xml==1.3.0
django-rest-swagger[reST]==0.3.7
dry-rest-permissions==0.1.6
edx-auth-backends==0.3.1
edx-auth-backends==0.5.0
edx-ccx-keys==0.2.0
edx-drf-extensions==0.5.1
edx-opaque-keys==0.3.1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment