feat: link local library
This commit is contained in:
+75
@@ -0,0 +1,75 @@
|
||||
{% extends 'rp_base.html' %}
|
||||
{% load i18n %}
|
||||
{% load static %}
|
||||
|
||||
{% block centered_container %}
|
||||
<script type="text/javascript">
|
||||
function startTimer(duration, display) {
|
||||
var timer = duration, minutes, seconds;
|
||||
setInterval(function () {
|
||||
minutes = parseInt(timer / 60, 10)
|
||||
seconds = parseInt(timer % 60, 10);
|
||||
|
||||
minutes = minutes < 10 ? "0" + minutes : minutes;
|
||||
seconds = seconds < 10 ? "0" + seconds : seconds;
|
||||
|
||||
display.text(minutes + ":" + seconds);
|
||||
|
||||
if (--timer < 0) {
|
||||
timer = duration;
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
jQuery(function ($) {
|
||||
var at_display = $('#at_time'),
|
||||
rt_display = $('#rt_time');
|
||||
startTimer({{ at_expiration }}, at_display);
|
||||
startTimer({{ rt_expiration }}, rt_display);
|
||||
});
|
||||
</script>
|
||||
<div class="col-12 p-4">
|
||||
{% csrf_token %}
|
||||
<h4 class="text-left">
|
||||
{% trans "User attributes" %}
|
||||
</h4>
|
||||
|
||||
<dl class="mt-4 mb-4">
|
||||
{% for attribute, value in oidc_rp_user_attrs.items %}
|
||||
<dt>{{ attribute }}:</dt>
|
||||
<dd>{{ value }}</dd>
|
||||
{% endfor %}
|
||||
</dl>
|
||||
|
||||
<a href="{% url 'spid_cie_rpinitiated_logout' %}" class="btn btn-secondary" role="button">Log out</a>
|
||||
<a href="{% url 'spid_cie_rp_echo_introspection' %}" class="btn btn-secondary" role="button">Verify Access Token (Introspection)</a>
|
||||
|
||||
</div>
|
||||
{% if rt_expiration == 0 %}
|
||||
<div class="col-12 p-4">
|
||||
<h4>{% trans "Warning" %}:</h4>
|
||||
<p>{% trans 'To enable revocable long sessions you must set <em>OIDCFED_ACR_PROFILES</em> in settingslocal.py of the Relying Party' %} <em>OIDCFED_ACR_PROFILES=["https://www.spid.gov.it/SpidL2","https://www.spid.gov.it/SpidL1"]</em></p>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="col-4 p-4">
|
||||
<h4 class="text-left">ACCESS TOKEN</h4>
|
||||
<p> {% trans "The" %} access token <em>{{ at_jti }}</em> <br />
|
||||
{% trans "expires in" %} <span id="at_time">{{ at_expiration }}</span> </p>
|
||||
</div>
|
||||
<div class="col-8 p-4">
|
||||
<h4 class="text-left">REFRESH TOKEN <a href="{% url 'spid_cie_rp_extend_session' %}" class="btn btn-primary btn-xs btn-me" role="button">{% trans "Extend Session" %}</a></h4>
|
||||
|
||||
<p> {% trans "The" %} Refresh Token <em>{{ rt_jti }}</em> <br />
|
||||
{% trans "expires in" %} <span id="rt_time">{{ rt_expiration }}</span> </p>
|
||||
<div class="alert alert-warning" role="alert">
|
||||
<p style="text-align:justify;">NB:
|
||||
<ul>
|
||||
<li>{% trans "By selecting CIE PROVIDER, the Refresh Token is allowed to be used during the time frame validity of the consent given by the user and is set by the Provider with the variable" %} <em>OIDCFED_PROVIDER_MAX_CONSENT_TIMEFRAME</em> {% trans "in settingslocal.py. Upon expiration the Provider returns error HTTP/400 and the RP example redirects to the landing page" %}</li>
|
||||
<li>{% trans "By selecting SPID PROVIDER, the number of Refresh Tokens that can be issued for a single session is set in the OPs configuration" %} <em>OIDCFED_PROVIDER_MAX_REFRESH</em>. {% trans "Past this number, the Provider returns error HTTP/400 and the RP example redirects to the landing page" %} </li>
|
||||
</ul>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
||||
+92
@@ -0,0 +1,92 @@
|
||||
<!-- Extends default Bootstrap Unical Italia template -->
|
||||
{% extends 'bootstrap-italia-base.html' %}
|
||||
|
||||
{% load static %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block extra_head %}
|
||||
{{ block.super }}
|
||||
<link type="text/css" rel="stylesheet" href="/static/css/access-button.css">
|
||||
{% endblock extra_head %}
|
||||
|
||||
{% block page_title %}
|
||||
{% trans "OIDC Relying Party Django" %}
|
||||
{% endblock page_title %}
|
||||
|
||||
<!-- URL link top left -->
|
||||
{% block header_slim_org_url %}
|
||||
https://www.spid.gov.it/
|
||||
{% endblock header_slim_org_url %}
|
||||
|
||||
<!-- Name top left -->
|
||||
{% block header_slim_org_name %}
|
||||
{% trans "OIDC Relying Party" %}
|
||||
{% endblock header_slim_org_name %}
|
||||
|
||||
<!-- Mobile slim_org_name -->
|
||||
{% block header_slim_mobile_org_name %}
|
||||
{% trans "OIDC Relying Party" %}
|
||||
{% endblock header_slim_mobile_org_name %}
|
||||
|
||||
<!-- Make empty areas -->
|
||||
{% block header_mobile_arrow %}{% endblock header_mobile_arrow %}
|
||||
{% block header_mobile_slim_menu %}{% endblock header_mobile_slim_menu %}
|
||||
|
||||
<!-- Logo in Header -->
|
||||
{% block header_center_logo %}
|
||||
{% endblock header_center_logo %}
|
||||
|
||||
|
||||
<!-- Organization name in Header -->
|
||||
{% block header_center_org_name %}
|
||||
<a href="{% url 'spid_cie_rp_landing'%}">{% trans "OIDC Relying Party" %}</a>
|
||||
{% endblock header_center_org_name %}
|
||||
|
||||
{% block main_menu %}{% endblock main_menu %}
|
||||
|
||||
<!-- Organization description in Header -->
|
||||
{% block header_center_org_subname %}
|
||||
{% endblock header_center_org_subname %}
|
||||
|
||||
{% block container %}
|
||||
<div>
|
||||
<div class="container pt-2 p-3">
|
||||
<div class="row d-lg-flex">
|
||||
<div class="col-12">
|
||||
<div class="card-wrapper card-space">
|
||||
<div class="card card-bg no-after">
|
||||
<div class="card-body">
|
||||
<div class="row h-100">
|
||||
{% block centered_container %}{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock container %}
|
||||
|
||||
<!-- Logo in Footer -->
|
||||
{% block footer_logo %}
|
||||
{% endblock footer_logo %}
|
||||
|
||||
<!-- Organization name in Footer -->
|
||||
{% block footer_org_name %}
|
||||
{% trans "OIDC Relying Party" %}
|
||||
{% endblock footer_org_name %}
|
||||
|
||||
<!-- Organization name in Footer -->
|
||||
{% block footer_org_subname %}
|
||||
{% trans "OIDC Relying Party" %}
|
||||
{% endblock footer_org_subname %}
|
||||
|
||||
{% block extra_scripts %}
|
||||
{% block bootstrap_italia_validation %}
|
||||
|
||||
{% endblock bootstrap_italia_validation %}
|
||||
{% endblock extra_scripts %}
|
||||
|
||||
{% block footer_menu_section %}
|
||||
{% endblock footer_menu_section %}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
<!-- Extends default Bootstrap Unical Italia template -->
|
||||
{% extends 'rp_base.html' %}
|
||||
{% load i18n %}
|
||||
{% load static %}
|
||||
|
||||
{% block centered_container %}
|
||||
|
||||
<div class="col-12 col-lg-6 pl-lg-4">
|
||||
{% csrf_token %}
|
||||
<div class="callout danger">
|
||||
<div class="callout-title">
|
||||
{% trans error%}
|
||||
</div>
|
||||
|
||||
<p>
|
||||
{% trans error_description%}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<script src="{% static 'js/spid-sp-access-button.js' %}"></script>
|
||||
<script src="{% static 'js/spid_button.js' %}"></script>
|
||||
|
||||
{% endblock %}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
{% extends 'rp_base.html' %}
|
||||
{% load i18n %}
|
||||
{% load static %}
|
||||
|
||||
{% block centered_container %}
|
||||
<div class="col-12 p-4">
|
||||
{% csrf_token %}
|
||||
<h4>{% trans 'Introspection values' %}</h4>
|
||||
|
||||
<dl class="mt-4 mb-4">
|
||||
{% for attribute, value in introspection.items %}
|
||||
<dt>{{ attribute }}:</dt>
|
||||
<dd>{{ value }}</dd>
|
||||
{% endfor %}
|
||||
</dl>
|
||||
|
||||
<a href="{% url 'spid_cie_rpinitiated_logout' %}" class="btn btn-secondary" role="button">Log out</a>
|
||||
<a href="javascript:history.back()" class="btn btn-secondary" role="button">Go Back</a>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
+135
@@ -0,0 +1,135 @@
|
||||
<!-- Extends default Bootstrap Unical Italia template -->
|
||||
{% extends 'rp_base.html' %}
|
||||
{% load i18n %}
|
||||
{% load static %}
|
||||
|
||||
{% block centered_container %}
|
||||
|
||||
<div class="col-12 pl-lg-4">
|
||||
|
||||
<div class="row p-3">
|
||||
<h3 class="text-left">
|
||||
{% trans "Welcome" %}
|
||||
</h3>
|
||||
|
||||
<p class="card-title">
|
||||
|
||||
{% blocktrans %}
|
||||
SPID is the access system that allows you to use online services with a unique digital identity.
|
||||
If you already have a digital identity, login with your Identity Provider.
|
||||
If you don’t have a digital identity yet, choose an Identity Provider where obtain your SPID Digital Identity.
|
||||
{% endblocktrans %}
|
||||
|
||||
</p>
|
||||
|
||||
<p class="card-title"></p>
|
||||
|
||||
{% blocktrans %}
|
||||
If you have the new Electronic Identity Card (CIE) you can use it to access the services
|
||||
online Public Administration. You need the PIN and PUK codes:
|
||||
the first part of the two codes is in the receipt of the CIE request, the second part is delivered
|
||||
together with the CIE. Visit the official site of CIE id to get the software, documentation and tutorial.
|
||||
{% endblocktrans %}
|
||||
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="row mt-3">
|
||||
<div class="col">
|
||||
<span
|
||||
class="badge square-corners mb-3 mr-2 ml-0 pr-10 p-2 mw-100">
|
||||
<a href="#" class="italia-it-button italia-it-button-size-m button-spid"
|
||||
spid-idp-button="#spid-idp-button-medium-get" aria-expanded="false">
|
||||
<span class="italia-it-button-icon"><img
|
||||
src="{% static 'svg/spid-ico-circle-bb.svg' %}"
|
||||
alt=""></span>
|
||||
<span class="italia-it-button-text">{% trans "Entra con SPID" %}</span>
|
||||
</a>
|
||||
<div id="spid-idp-button-medium-get"
|
||||
class="spid-idp-button spid-idp-button-tip spid-idp-button-relative"
|
||||
style="display: none; left: 56.5px; top: 46.05px;">
|
||||
|
||||
<ul id="spid-idp-list-medium-root-get" class="spid-idp-button-menu"
|
||||
aria-labelledby="spid-idp">
|
||||
{% for sub, attrs in spid_providers.items %}
|
||||
<li>
|
||||
<a href="{% url 'spid_cie_rp_begin' %}?provider={{sub}}&profile=spid" id="provider-spid">
|
||||
<span class="spid-sr-only">{{ attrs.organization_name }}</span>
|
||||
{% if attrs.logo_uri %}
|
||||
<img src="{{ attrs.logo_uri }}" alt="{{ attrs.organization_name }}">
|
||||
{% else %}
|
||||
<img src="{% static 'svg/no_image_available.svg' %}" alt="{{ sub }}">
|
||||
<p>{{ sub }}</p>
|
||||
{% endif %}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{% url 'spid_cie_rp_begin' %}?provider={{sub}}&profile=spid&scope=openid offline_access" id="provider-spid-refresh_token">
|
||||
<span class="spid-sr-only">{{ attrs.organization_name }}</span>
|
||||
{% if attrs.logo_uri %}
|
||||
<img src="{{ attrs.logo_uri }}-LTS.svg" alt="{{ attrs.organization_name }}">
|
||||
{% else %}
|
||||
<img src="{% static 'svg/no_image_available.svg' %}" alt="{{ sub }}">
|
||||
<p>{{ sub }}</p>
|
||||
{% endif %}
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</span>
|
||||
|
||||
<span
|
||||
class="badge square-corners mb-3 mr-2 ml-0 pr-10 p-2 mw-100"
|
||||
style="font-size: 100%">
|
||||
|
||||
<a href="#" class="italia-it-button italia-it-button-size-m button-cie"
|
||||
cie-idp-button="#cie-idp-button-medium-get">
|
||||
<span class="italia-it-button-icon"><img
|
||||
src="{% static 'svg/cie-ico-circle-bb.svg' %}"
|
||||
alt="">
|
||||
</span>
|
||||
<span class="italia-it-button-text">{% trans "Entra con CIE" %}</span>
|
||||
</a>
|
||||
<div id="cie-idp-button-medium-get"
|
||||
class="cie-idp-button cie-idp-button-tip cie-idp-button-relative"
|
||||
style="display: none; left: 56.5px; top: 46.05px;">
|
||||
|
||||
<ul id="cie-idp-list-medium-root-get" class="cie-idp-button-menu" aria-labelledby="cie-idp">
|
||||
{% for sub, attrs in cie_providers.items %}
|
||||
<li>
|
||||
<a href="{% url 'spid_cie_rp_begin' %}?provider={{sub}}&profile=cie" id="provider-cie">
|
||||
<span class="spid-sr-only">{{ attrs.organization_name }}</span>
|
||||
{% if attrs.logo_uri %}
|
||||
<img src="{{ attrs.logo_uri }}" alt="{{ attrs.organization_name }}">
|
||||
{% else %}
|
||||
<img src="{% static 'svg/no_image_available.svg' %}" alt="{{ sub }}">
|
||||
<p>{{ sub }}</p>
|
||||
{% endif %}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{% url 'spid_cie_rp_begin' %}?provider={{sub}}&profile=cie&scope=openid offline_access" id="provider-cie-refresh_token">
|
||||
<span class="spid-sr-only">{{ attrs.organization_name }} {% trans "INCLUDING REFRESH TOKEN" %}</span>
|
||||
{% if attrs.logo_uri %}
|
||||
<img src="{{ attrs.logo_uri }}" alt="{{ attrs.organization_name }}">
|
||||
<p>{% trans "INCLUDING REFRESH TOKEN" %}</p>
|
||||
{% else %}
|
||||
<img src="{% static 'svg/no_image_available.svg' %}" alt="{{ sub }}">
|
||||
|
||||
{% endif %}
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<script src="{% static 'js/spid-sp-access-button.js' %}"></script>
|
||||
<script src="{% static 'js/spid_button.js' %}"></script>
|
||||
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user