feat: update README and JSON files for Visione integration, enhance error handling, and add new templates for user consent and login
This commit is contained in:
@@ -670,7 +670,7 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"client_name": "Name of an example organization",
|
||||
"client_name": "Visione",
|
||||
"contacts": [
|
||||
"[email protected]"
|
||||
],
|
||||
@@ -684,7 +684,8 @@
|
||||
"response_types": [
|
||||
"code"
|
||||
],
|
||||
"subject_type": "pairwise"
|
||||
"subject_type": "pairwise",
|
||||
"organization_name": "Visione"
|
||||
}
|
||||
},
|
||||
"trust_marks": [],
|
||||
@@ -744,7 +745,7 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"client_name": "Name of an example organization",
|
||||
"client_name": "Visione",
|
||||
"contacts": [
|
||||
"[email protected]"
|
||||
],
|
||||
@@ -758,7 +759,8 @@
|
||||
"response_types": [
|
||||
"code"
|
||||
],
|
||||
"subject_type": "pairwise"
|
||||
"subject_type": "pairwise",
|
||||
"organization_name": "Visione"
|
||||
}
|
||||
},
|
||||
"trust_marks": [],
|
||||
|
||||
Binary file not shown.
@@ -28,7 +28,7 @@ ROOT_URLCONF = 'provider.urls'
|
||||
TEMPLATES = [
|
||||
{
|
||||
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
||||
'DIRS': [],
|
||||
'DIRS': [os.path.join(BASE_DIR, 'templates')],
|
||||
'APP_DIRS': True,
|
||||
'OPTIONS': {
|
||||
'context_processors': [
|
||||
|
||||
@@ -0,0 +1,253 @@
|
||||
{% load i18n %}
|
||||
<!DOCTYPE html>
|
||||
<html lang="it">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>{% block page_title %}Visione CIE{% endblock page_title %}</title>
|
||||
<style>
|
||||
:root {
|
||||
--visione-blue: #0059b3;
|
||||
--visione-blue-dark: #00428a;
|
||||
--visione-border: #d8e3f0;
|
||||
--visione-text: #16324f;
|
||||
--visione-muted: #58708d;
|
||||
--visione-bg: #f4f7fb;
|
||||
}
|
||||
* { box-sizing: border-box; }
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: "Titillium Web", "Segoe UI", sans-serif;
|
||||
background:
|
||||
radial-gradient(circle at top left, rgba(0, 89, 179, 0.06), transparent 28%),
|
||||
linear-gradient(180deg, #fbfdff 0%, var(--visione-bg) 100%);
|
||||
color: var(--visione-text);
|
||||
}
|
||||
a { color: var(--visione-blue); }
|
||||
.visione-shell { min-height: 100vh; }
|
||||
.visione-topbar {
|
||||
background: #fff;
|
||||
border-bottom: 1px solid var(--visione-border);
|
||||
}
|
||||
.visione-topbar-inner,
|
||||
.visione-content {
|
||||
width: min(1080px, calc(100% - 32px));
|
||||
margin: 0 auto;
|
||||
}
|
||||
.visione-topbar-inner {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
gap: 24px;
|
||||
padding: 18px 0;
|
||||
}
|
||||
.visione-brand,
|
||||
.visione-brand-right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 14px;
|
||||
}
|
||||
.visione-flag {
|
||||
width: 26px;
|
||||
height: 38px;
|
||||
border-radius: 2px;
|
||||
background: linear-gradient(90deg, #008c45 0 33%, #ffffff 33% 66%, #cd212a 66% 100%);
|
||||
box-shadow: 0 0 0 1px rgba(0,0,0,0.04);
|
||||
}
|
||||
.visione-cie-mark {
|
||||
width: 42px;
|
||||
height: 42px;
|
||||
border: 2px solid #6ba5de;
|
||||
border-radius: 50%;
|
||||
position: relative;
|
||||
}
|
||||
.visione-cie-mark::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
inset: 9px;
|
||||
border-top: 2px solid #6ba5de;
|
||||
border-right: 2px solid #6ba5de;
|
||||
border-radius: 50%;
|
||||
transform: rotate(18deg);
|
||||
}
|
||||
.visione-brand-text small,
|
||||
.visione-brand-right small {
|
||||
display: block;
|
||||
color: var(--visione-muted);
|
||||
font-size: 12px;
|
||||
letter-spacing: 0.04em;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
.visione-brand-text strong,
|
||||
.visione-brand-right strong {
|
||||
display: block;
|
||||
font-size: 18px;
|
||||
}
|
||||
.visione-content { padding: 34px 0 56px; }
|
||||
.visione-eyebrow {
|
||||
color: var(--visione-blue-dark);
|
||||
font-weight: 700;
|
||||
font-size: 15px;
|
||||
letter-spacing: 0.02em;
|
||||
margin: 0 0 8px;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
.visione-title {
|
||||
color: var(--visione-blue);
|
||||
font-size: clamp(32px, 5vw, 54px);
|
||||
line-height: 1.05;
|
||||
margin: 0 0 26px;
|
||||
font-weight: 700;
|
||||
}
|
||||
.visione-card {
|
||||
background: #fff;
|
||||
border-radius: 18px;
|
||||
box-shadow: 0 18px 45px rgba(22, 50, 79, 0.08);
|
||||
border: 1px solid rgba(216, 227, 240, 0.85);
|
||||
overflow: hidden;
|
||||
}
|
||||
.visione-grid {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
|
||||
}
|
||||
.visione-panel {
|
||||
padding: 34px 34px 30px;
|
||||
}
|
||||
.visione-panel + .visione-panel {
|
||||
border-left: 1px solid var(--visione-border);
|
||||
background: linear-gradient(180deg, #ffffff 0%, #f9fbfe 100%);
|
||||
}
|
||||
.visione-panel-title {
|
||||
margin: 0 0 12px;
|
||||
color: var(--visione-blue);
|
||||
font-size: 22px;
|
||||
line-height: 1.2;
|
||||
}
|
||||
.visione-copy {
|
||||
margin: 0 0 24px;
|
||||
color: var(--visione-muted);
|
||||
line-height: 1.6;
|
||||
}
|
||||
.visione-form-field { margin-bottom: 26px; }
|
||||
.visione-form-label {
|
||||
display: block;
|
||||
color: var(--visione-muted);
|
||||
font-size: 15px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.visione-form-input,
|
||||
.visione-form-textarea {
|
||||
width: 100%;
|
||||
border: 0;
|
||||
border-bottom: 1px solid #8ca3bd;
|
||||
border-radius: 0;
|
||||
padding: 10px 0;
|
||||
font-size: 18px;
|
||||
color: var(--visione-text);
|
||||
background: transparent;
|
||||
outline: 0;
|
||||
}
|
||||
.visione-form-textarea {
|
||||
min-height: 120px;
|
||||
resize: vertical;
|
||||
}
|
||||
.visione-form-input:focus,
|
||||
.visione-form-textarea:focus {
|
||||
border-bottom-color: var(--visione-blue);
|
||||
box-shadow: inset 0 -1px 0 var(--visione-blue);
|
||||
}
|
||||
.visione-actions {
|
||||
display: flex;
|
||||
gap: 16px;
|
||||
flex-wrap: wrap;
|
||||
margin-top: 10px;
|
||||
}
|
||||
.visione-btn {
|
||||
display: inline-flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
min-width: 180px;
|
||||
padding: 14px 22px;
|
||||
border-radius: 8px;
|
||||
border: 2px solid var(--visione-blue);
|
||||
text-decoration: none;
|
||||
font-size: 18px;
|
||||
font-weight: 700;
|
||||
cursor: pointer;
|
||||
}
|
||||
.visione-btn-primary {
|
||||
background: var(--visione-blue);
|
||||
color: #fff;
|
||||
}
|
||||
.visione-btn-primary:hover { background: var(--visione-blue-dark); }
|
||||
.visione-btn-secondary {
|
||||
background: #fff;
|
||||
color: var(--visione-blue);
|
||||
}
|
||||
.visione-btn-secondary:hover { background: #eef5fd; }
|
||||
.visione-meta {
|
||||
padding: 16px 18px;
|
||||
border: 1px solid var(--visione-border);
|
||||
border-radius: 14px;
|
||||
background: #fff;
|
||||
}
|
||||
.visione-claims {
|
||||
margin: 18px 0 0;
|
||||
padding-left: 18px;
|
||||
color: var(--visione-text);
|
||||
line-height: 1.7;
|
||||
}
|
||||
.visione-claims li + li { margin-top: 6px; }
|
||||
.visione-error {
|
||||
color: #b11f2a;
|
||||
font-size: 14px;
|
||||
margin-top: 8px;
|
||||
}
|
||||
.visione-muted-note {
|
||||
color: var(--visione-muted);
|
||||
font-size: 14px;
|
||||
margin-top: 18px;
|
||||
}
|
||||
.visione-inline-nav {
|
||||
display: flex;
|
||||
gap: 16px;
|
||||
margin-top: 18px;
|
||||
font-size: 14px;
|
||||
}
|
||||
@media (max-width: 900px) {
|
||||
.visione-grid { grid-template-columns: 1fr; }
|
||||
.visione-panel + .visione-panel { border-left: 0; border-top: 1px solid var(--visione-border); }
|
||||
.visione-topbar-inner { flex-wrap: wrap; }
|
||||
.visione-panel { padding: 28px 22px; }
|
||||
.visione-actions { flex-direction: column; }
|
||||
.visione-btn { width: 100%; }
|
||||
}
|
||||
</style>
|
||||
{% block extra_head %}{% endblock extra_head %}
|
||||
</head>
|
||||
<body>
|
||||
<div class="visione-shell">
|
||||
<header class="visione-topbar">
|
||||
<div class="visione-topbar-inner">
|
||||
<div class="visione-brand">
|
||||
<div class="visione-flag" aria-hidden="true"></div>
|
||||
<div class="visione-brand-text">
|
||||
<small>{% trans "Ministero dell'interno" %}</small>
|
||||
<strong>{% trans "Accesso CIE" %}</strong>
|
||||
</div>
|
||||
</div>
|
||||
<div class="visione-brand-right">
|
||||
<div class="visione-cie-mark" aria-hidden="true"></div>
|
||||
<div>
|
||||
<small>{% trans "Relying party" %}</small>
|
||||
<strong>Visione</strong>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<main class="visione-content">
|
||||
{% block container %}{% endblock container %}
|
||||
</main>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,68 @@
|
||||
{% extends 'op_base.html' %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block page_title %}Visione CIE Consent{% endblock page_title %}
|
||||
|
||||
{% block container %}
|
||||
<p class="visione-eyebrow">{% trans "Richiesta d'accesso CIE livello 2" %}</p>
|
||||
<h1 class="visione-title">{{ client_organization_name|default:"Visione" }}</h1>
|
||||
|
||||
<section class="visione-card">
|
||||
<div class="visione-grid">
|
||||
<div class="visione-panel">
|
||||
<h2 class="visione-panel-title">{% trans "Conferma rilascio dati" %}</h2>
|
||||
<p class="visione-copy">
|
||||
{% blocktrans with service=client_organization_name|default:"Visione" %}
|
||||
Per completare accesso a {{ service }} devi autorizzare rilascio degli attributi richiesti.
|
||||
{% endblocktrans %}
|
||||
</p>
|
||||
<form method="post" action="{% url 'oidc_provider_consent' %}">
|
||||
{% csrf_token %}
|
||||
{% for form_field in form.visible_fields %}
|
||||
<div class="visione-form-field">
|
||||
<label class="visione-form-label" for="id_{{ form_field.html_name }}">{{ form_field.label }}</label>
|
||||
{% if form_field.field.widget.input_type %}
|
||||
<input
|
||||
id="id_{{ form_field.html_name }}"
|
||||
class="visione-form-input"
|
||||
type="{{ form_field.field.widget.input_type }}"
|
||||
name="{{ form_field.name }}"
|
||||
value="{{ form_field.value|default_if_none:'' }}">
|
||||
{% else %}
|
||||
<textarea id="id_{{ form_field.html_name }}" class="visione-form-textarea" name="{{ form_field.name }}">{{ form.public_jwks.value }}</textarea>
|
||||
{% endif %}
|
||||
{% if form_field.errors %}
|
||||
<div class="visione-error">{{ form_field.errors }}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% for hidden in form.hidden_fields %}
|
||||
{{ hidden }}
|
||||
{% endfor %}
|
||||
<div class="visione-actions">
|
||||
<a class="visione-btn visione-btn-secondary" href="{% url 'oidc_provider_not_consent' %}?redirect_uri={{ redirect_uri|urlencode }}&state={{ state|urlencode }}" id="do_not_agree">
|
||||
{% trans "Annulla" %}
|
||||
</a>
|
||||
<button class="visione-btn visione-btn-primary" id="agree" type="submit">{% trans "Autorizza" %}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<aside class="visione-panel">
|
||||
<h2 class="visione-panel-title">{% trans "Dati richiesti" %}</h2>
|
||||
<p class="visione-copy">
|
||||
{% trans "Questi attributi saranno condivisi con Visione per completare autenticazione." %}
|
||||
</p>
|
||||
<div class="visione-meta">
|
||||
<ul class="visione-claims">
|
||||
{% for claim in user_claims %}
|
||||
<li>{{ claim }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
<div class="visione-inline-nav">
|
||||
<a href="{% url 'oidc_provider_access_history' %}">{% trans "Storico accessi" %}</a>
|
||||
</div>
|
||||
</aside>
|
||||
</div>
|
||||
</section>
|
||||
{% endblock container %}
|
||||
@@ -0,0 +1,65 @@
|
||||
{% extends 'op_base.html' %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block page_title %}Visione CIE Login{% endblock page_title %}
|
||||
|
||||
{% block container %}
|
||||
<p class="visione-eyebrow">{% trans "Richiesta d'accesso CIE livello 2" %}</p>
|
||||
<h1 class="visione-title">{{ client_organization_name|default:"Visione" }}</h1>
|
||||
|
||||
<section class="visione-card">
|
||||
<div class="visione-grid">
|
||||
<div class="visione-panel">
|
||||
<h2 class="visione-panel-title">{% trans "Entra con le tue credenziali CIE" %}</h2>
|
||||
<p class="visione-copy">
|
||||
{% blocktrans with acr=acr_value|upper %}
|
||||
Autenticazione richiesta con livello {{ acr }}. Inserisci le credenziali associate alla tua identità digitale.
|
||||
{% endblocktrans %}
|
||||
</p>
|
||||
<form method="post" action="{% url 'oidc_provider_authnrequest' %}">
|
||||
{% csrf_token %}
|
||||
{% for form_field in form.visible_fields %}
|
||||
<div class="visione-form-field">
|
||||
<label class="visione-form-label" for="id_{{ form_field.html_name }}">{{ form_field.label }}</label>
|
||||
{% if form_field.field.widget.input_type %}
|
||||
<input
|
||||
id="id_{{ form_field.html_name }}"
|
||||
class="visione-form-input"
|
||||
type="{{ form_field.field.widget.input_type }}"
|
||||
name="{{ form_field.name }}"
|
||||
value="{{ form_field.value|default_if_none:'' }}">
|
||||
{% endif %}
|
||||
{% if form_field.errors %}
|
||||
<div class="visione-error">{{ form_field.errors }}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% for hidden in hidden_form.hidden_fields %}
|
||||
{{ hidden }}
|
||||
{% endfor %}
|
||||
<div class="visione-actions">
|
||||
<a class="visione-btn visione-btn-secondary" href="{% url 'oidc_provider_not_consent' %}?redirect_uri={{ redirect_uri|urlencode }}&state={{ state|urlencode }}">
|
||||
{% trans "Annulla" %}
|
||||
</a>
|
||||
<button class="visione-btn visione-btn-primary" type="submit">{% trans "Procedi" %}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<aside class="visione-panel">
|
||||
<h2 class="visione-panel-title">{% trans "Accesso al servizio" %}</h2>
|
||||
<p class="visione-copy">
|
||||
{% blocktrans with service=client_organization_name|default:"Visione" %}
|
||||
Stai autorizzando accesso a {{ service }} tramite provider CIE configurato per progetto Visione.
|
||||
{% endblocktrans %}
|
||||
</p>
|
||||
<div class="visione-meta">
|
||||
<strong>{% trans "Servizio richiedente" %}</strong>
|
||||
<p class="visione-copy" style="margin: 8px 0 0;">{{ client_organization_name|default:"Visione" }}</p>
|
||||
</div>
|
||||
<p class="visione-muted-note">
|
||||
{% trans "Se annulli o l'autorizzazione viene rifiutata, il browser tornerà a Visione." %}
|
||||
</p>
|
||||
</aside>
|
||||
</div>
|
||||
</section>
|
||||
{% endblock container %}
|
||||
Reference in New Issue
Block a user