From e28ded107d16cb85951fff101d71ec9a3574be8b Mon Sep 17 00:00:00 2001 From: stvnrlly Date: Fri, 27 Jan 2017 15:46:45 -0500 Subject: [PATCH] configure uaa_client setup --- acquisitions/settings.py | 5 +---- acquisitions/urls.py | 5 +++-- web/templates/admin/add_user_form.html | 12 ++++++++++++ web/templates/uaa_client/logged_out.html | 14 ++++++++++++++ web/templates/uaa_client/oauth2_error.html | 18 ++++++++++++++++++ 5 files changed, 48 insertions(+), 6 deletions(-) create mode 100644 web/templates/admin/add_user_form.html create mode 100644 web/templates/uaa_client/logged_out.html create mode 100644 web/templates/uaa_client/oauth2_error.html diff --git a/acquisitions/settings.py b/acquisitions/settings.py index bfd4cda..1a24c8c 100644 --- a/acquisitions/settings.py +++ b/acquisitions/settings.py @@ -51,7 +51,6 @@ 'team', 'web', 'nda', - 'uaa_client', 'news', 'acquisitions', @@ -163,12 +162,10 @@ LOGIN_REDIRECT_URL = '/' -if DEBUG: - INSTALLED_APPS += ('fake_uaa_provider',) - if not UAA_CLIENT_SECRET: if DEBUG: # We'll be using the Fake UAA Provider. + INSTALLED_APPS += ('uaa_client.fake_uaa_provider',) UAA_CLIENT_SECRET = 'fake-uaa-provider-client-secret' UAA_AUTH_URL = UAA_TOKEN_URL = 'fake:' else: diff --git a/acquisitions/urls.py b/acquisitions/urls.py index d83f68d..66596e5 100644 --- a/acquisitions/urls.py +++ b/acquisitions/urls.py @@ -60,11 +60,12 @@ url(r'^profile/$', web_views.profile), url(r'^profile/refresh_token/$', web_views.refresh_token), url(r'^profile/sign_nda/$', nda_views.sign_nda), - url(r'^auth/', include('uaa_client.urls', namespace='uaa_client')), + # url(r'^auth/', include('uaa_client.urls', namespace='uaa_client')), + url(r'^auth/', include('uaa_client.urls')), ] if settings.DEBUG: urlpatterns += [ - url(r'^', include('fake_uaa_provider.urls', + url(r'^', include('uaa_client.fake_uaa_provider.urls', namespace='fake_uaa_provider')) ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) diff --git a/web/templates/admin/add_user_form.html b/web/templates/admin/add_user_form.html new file mode 100644 index 0000000..dc2f361 --- /dev/null +++ b/web/templates/admin/add_user_form.html @@ -0,0 +1,12 @@ +{% extends "admin/change_form.html" %} +{% load i18n %} + +{# This file is based on https://github.com/django/django/blob/master/django/contrib/admin/templates/admin/auth/user/add_form.html. #} + +{% block form_top %} + {% if not is_popup %} +

First, enter an email address. Then, you'll be able to edit more user options.

+ {% else %} +

Enter an email address.

+ {% endif %} +{% endblock %} diff --git a/web/templates/uaa_client/logged_out.html b/web/templates/uaa_client/logged_out.html new file mode 100644 index 0000000..4d7486d --- /dev/null +++ b/web/templates/uaa_client/logged_out.html @@ -0,0 +1,14 @@ +{% extends "web/base.html" %} + +{% block content %} +
+
+

Logged out

+ +
+

You have successfully logged out.

+

Return to the home page.

+
+
+
+{% endblock %} diff --git a/web/templates/uaa_client/oauth2_error.html b/web/templates/uaa_client/oauth2_error.html new file mode 100644 index 0000000..7e86690 --- /dev/null +++ b/web/templates/uaa_client/oauth2_error.html @@ -0,0 +1,18 @@ +{% extends "web/base.html" %} + +{% block content %} +
+
+

Login Error

+ {% if error_code == 'invalid_code_or_nonexistent_user' %} +

+ Either you don't have permission to log in to this system, or + an error occurred when trying to log you in. +

+ {% else %} +

Unfortunately, an error occurred when trying to log you in.

+

Error code: {{ error_code }}

+ {% endif %} +
+
+{% endblock %}