Fix in example project.

This commit is contained in:
Ignacio 2016-04-06 21:28:13 -03:00
parent 9c071831fa
commit 93c0bc2382
5 changed files with 38 additions and 31 deletions

View file

@ -87,3 +87,5 @@ LOGIN_REDIRECT_URL = '/'
# OIDC Provider settings
SITE_URL = 'http://localhost:8000'
LOGIN_URL = '/admin/login/'

View file

@ -19,13 +19,12 @@
<a href="{% url 'home' %}" class=" item">django-oidc-provider</a>
<div class="right menu">
{% if user.is_authenticated %}
<a href="#" class="item">{{ user.email }}</a>
{% if user.is_superuser %}
<a href="{% url 'admin:index' %}" class="item">Admin</a>
{% endif %}
<a href="{% url 'logout' %}" class="item"><i class="remove icon"></i></a>
<a href="{% url 'admin:logout' %}" class="item"><i class="remove icon"></i></a>
{% else %}
<a href="{% url 'login' %}" class="item">Login</a>
<a href="{% url 'admin:login' %}" class="item">Login</a>
{% endif %}
</div>
</div>

View file

@ -2,25 +2,29 @@
{% block content %}
<div class="ui page grid">
<div class="nine wide centered column">
<div class="ui segment">
<h1 class="ui dividing header">Request for Permission</h1>
<p>Client <i>{{ client.name }}</i> would like to access this information of you.</p>
<form method="post" action="{% url 'oidc_provider:authorize' %}">
{% csrf_token %}
{{ hidden_inputs }}
<div class="ui bulleted list">
{% for scope in params.scope %}
<div class="item">{{ scope | capfirst }}</div>
{% endfor %}
<div class="ui container" style="margin-top:100px">
<div class="ui stackable grid">
<div class="row">
<div class="eight wide centered column">
<div class="ui segment">
<h1 class="ui dividing header">Request for Permission</h1>
<p>Client <i>{{ client.name }}</i> would like to access this information of you.</p>
<form method="post" action="{% url 'oidc_provider:authorize' %}">
{% csrf_token %}
{{ hidden_inputs }}
<div class="ui bulleted list">
{% for scope in params.scope %}
<div class="item">{{ scope | capfirst }}</div>
{% endfor %}
</div>
<div class="ui fluid large buttons">
<input class="ui button" type="submit" value="Cancel" />
<div class="or"></div>
<input name="allow" class="positive ui button" type="submit" value="Authorize" />
</div>
</form>
</div>
<div class="ui fluid large buttons">
<input class="ui button" type="submit" value="Cancel" />
<div class="or"></div>
<input name="allow" class="positive ui button" type="submit" value="Authorize" />
</div>
</form>
</div>
</div>
</div>
</div>

View file

@ -2,13 +2,17 @@
{% block content %}
<div class="ui page grid">
<div class="nine wide centered column">
<div class="ui icon negative large message">
<i class="meh icon"></i>
<div class="content">
<div class="header">{{ error }}</div>
<p>{{ description }}</p>
<div class="ui container" style="margin-top:100px">
<div class="ui stackable grid">
<div class="row">
<div class="eight wide centered column">
<div class="ui icon negative large message">
<i class="meh icon"></i>
<div class="content">
<div class="header">{{ error }}</div>
<p>{{ description }}</p>
</div>
</div>
</div>
</div>
</div>

View file

@ -6,10 +6,8 @@ from django.views.generic import TemplateView
urlpatterns = [
url(r'^$', TemplateView.as_view(template_name='home.html'), name='home'),
url(r'^accounts/login/$', auth_views.login, { 'template_name': 'login.html' }, name='login'),
url(r'^accounts/logout/$', auth_views.logout, { 'next_page': '/' }, name='logout'),
url(r'^openid/', include('oidc_provider.urls', namespace='oidc_provider')),
url(r'^', include('oidc_provider.urls', namespace='oidc_provider')),
url(r'^admin/', include(admin.site.urls)),
]