From 903422b861fed76b065052006d13877696a2cefb Mon Sep 17 00:00:00 2001 From: Greg Price Date: Mon, 13 Apr 2015 12:46:28 -0400 Subject: [PATCH] Enable OAuth token exchange only if OAuth provider --- lms/urls.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lms/urls.py b/lms/urls.py index 512cb159ba..d149b90d9f 100644 --- a/lms/urls.py +++ b/lms/urls.py @@ -597,14 +597,19 @@ if settings.FEATURES.get('AUTOMATIC_AUTH_FOR_TESTING'): if settings.FEATURES.get('ENABLE_THIRD_PARTY_AUTH'): urlpatterns += ( url(r'', include('third_party_auth.urls')), + # NOTE: The following login_oauth_token endpoint is DEPRECATED. + # Please use the exchange_access_token endpoint instead. + url(r'^login_oauth_token/(?P[^/]+)/$', 'student.views.login_oauth_token'), + ) + +# OAuth token exchange +if settings.FEATURES.get('ENABLE_THIRD_PARTY_AUTH') and settings.FEATURES.get('ENABLE_OAUTH2_PROVIDER'): + urlpatterns += ( url( r'^oauth2/exchange_access_token/(?P[^/]+)/$', oauth_exchange.views.AccessTokenExchangeView.as_view(), name="exchange_access_token" ), - # NOTE: The following login_oauth_token endpoint is DEPRECATED. - # Please use the exchange_access_token endpoint instead. - url(r'^login_oauth_token/(?P[^/]+)/$', 'student.views.login_oauth_token'), ) # Certificates Web/HTML View