Skip to content
This repository has been archived by the owner on Aug 27, 2019. It is now read-only.

Commit

Permalink
configure uaa_client setup
Browse files Browse the repository at this point in the history
  • Loading branch information
stvnrlly committed Jan 27, 2017
1 parent 0949681 commit e28ded1
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 6 deletions.
5 changes: 1 addition & 4 deletions acquisitions/settings.py
Expand Up @@ -51,7 +51,6 @@
'team',
'web',
'nda',
'uaa_client',
'news',
'acquisitions',

Expand Down Expand Up @@ -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:
Expand Down
5 changes: 3 additions & 2 deletions acquisitions/urls.py
Expand Up @@ -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)
12 changes: 12 additions & 0 deletions 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 %}
<p>First, enter an email address. Then, you'll be able to edit more user options.</p>
{% else %}
<p>Enter an email address.</p>
{% endif %}
{% endblock %}
14 changes: 14 additions & 0 deletions web/templates/uaa_client/logged_out.html
@@ -0,0 +1,14 @@
{% extends "web/base.html" %}

{% block content %}
<section class="usa-grid">
<div class="usa-width-one-full">
<h1>Logged out</h1>

<div class="alert alert-success">
<h3>You have successfully logged out.</h3>
<p>Return to the <a href="/">home page</a>.</p>
</div>
</div>
</section>
{% endblock %}
18 changes: 18 additions & 0 deletions web/templates/uaa_client/oauth2_error.html
@@ -0,0 +1,18 @@
{% extends "web/base.html" %}

{% block content %}
<section class="usa-grid">
<div class="usa-width-one-full">
<h1>Login Error</h1>
{% if error_code == 'invalid_code_or_nonexistent_user' %}
<p>
Either you don't have permission to log in to this system, or
an error occurred when trying to log you in.
</p>
{% else %}
<p>Unfortunately, an error occurred when trying to log you in.</p>
<p>Error code: <code>{{ error_code }}</code></p>
{% endif %}
</div>
</section>
{% endblock %}

0 comments on commit e28ded1

Please sign in to comment.