2016-02-11 20:24:34 +00:00
|
|
|
.. _templates:
|
|
|
|
|
|
|
|
Templates
|
|
|
|
#########
|
|
|
|
|
|
|
|
Add your own templates files inside a folder named ``templates/oidc_provider/``.
|
2017-12-14 17:30:46 +00:00
|
|
|
You can copy the sample html files here and customize them with your own style.
|
2016-02-11 20:24:34 +00:00
|
|
|
|
|
|
|
**authorize.html**::
|
|
|
|
|
|
|
|
<h1>Request for Permission</h1>
|
|
|
|
|
|
|
|
<p>Client <strong>{{ client.name }}</strong> would like to access this information of you ...</p>
|
|
|
|
|
|
|
|
<form method="post" action="{% url 'oidc_provider:authorize' %}">
|
2016-12-02 15:03:59 +00:00
|
|
|
|
2016-02-11 20:24:34 +00:00
|
|
|
{% csrf_token %}
|
|
|
|
|
|
|
|
{{ hidden_inputs }}
|
|
|
|
|
|
|
|
<ul>
|
2017-12-14 17:30:46 +00:00
|
|
|
{% for scope in scopes %}
|
2016-12-02 15:03:59 +00:00
|
|
|
<li><strong>{{ scope.name }}</strong><br><i>{{ scope.description }}</i></li>
|
2016-02-11 20:24:34 +00:00
|
|
|
{% endfor %}
|
|
|
|
</ul>
|
|
|
|
|
2016-12-02 15:03:59 +00:00
|
|
|
<input type="submit" value="Decline" />
|
2016-02-11 20:24:34 +00:00
|
|
|
<input name="allow" type="submit" value="Authorize" />
|
|
|
|
|
|
|
|
</form>
|
|
|
|
|
|
|
|
**error.html**::
|
|
|
|
|
|
|
|
<h3>{{ error }}</h3>
|
|
|
|
<p>{{ description }}</p>
|
2017-05-05 03:19:57 +00:00
|
|
|
|
|
|
|
You can also customize paths to your custom templates by putting them in ``OIDC_TEMPLATES`` in the settings.
|
|
|
|
|
2017-12-14 17:30:46 +00:00
|
|
|
The following contexts will be passed to the ``authorize`` and ``error`` templates respectively::
|
|
|
|
|
|
|
|
# For authorize template
|
|
|
|
{
|
|
|
|
'client': 'an instance of Client for the auth request',
|
|
|
|
'hidden_inputs': 'a rendered html with all the hidden inputs needed for AuthorizeEndpoint',
|
|
|
|
'params': 'a dict containing the params in the auth request',
|
|
|
|
'scopes': 'a list of scopes'
|
|
|
|
}
|
|
|
|
|
|
|
|
# For error template
|
|
|
|
{
|
|
|
|
'error': 'string stating the error',
|
|
|
|
'description': 'string stating description of the error'
|
|
|
|
}
|