parent
b2f6688190
commit
0a81164beb
|
@ -1,45 +0,0 @@
|
|||
# authentic2 - versatile identity manager
|
||||
# Copyright (C) 2010-2019 Entr'ouvert
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify it
|
||||
# under the terms of the GNU Affero General Public License as published
|
||||
# by the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from django.contrib.auth.decorators import login_required
|
||||
from django.http import HttpResponseRedirect
|
||||
from django.shortcuts import render
|
||||
|
||||
|
||||
@login_required
|
||||
def consent_federation(request, nonce='', provider_id=None):
|
||||
"""On a GET produce a form asking for consentment,
|
||||
On a POST handle the form and redirect to next"""
|
||||
if request.method == 'GET':
|
||||
return render(
|
||||
request,
|
||||
'interaction/consent_federation.html',
|
||||
{
|
||||
'provider_id': request.GET.get('provider_id', ''),
|
||||
'nonce': request.GET.get('nonce', ''),
|
||||
'next': request.GET.get('next', ''),
|
||||
},
|
||||
)
|
||||
else:
|
||||
next_url = '/'
|
||||
if 'next' in request.POST:
|
||||
next_url = request.POST['next']
|
||||
if 'accept' in request.POST:
|
||||
next_url = next_url + '&consent_answer=accepted'
|
||||
return HttpResponseRedirect(next_url)
|
||||
else:
|
||||
next_url = next_url + '&consent_answer=refused'
|
||||
return HttpResponseRedirect(next)
|
|
@ -1,86 +0,0 @@
|
|||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='AttributePolicy',
|
||||
fields=[
|
||||
(
|
||||
'id',
|
||||
models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True),
|
||||
),
|
||||
('name', models.CharField(unique=True, max_length=100)),
|
||||
('enabled', models.BooleanField(default=False, verbose_name='Enabled')),
|
||||
(
|
||||
'ask_consent_attributes',
|
||||
models.BooleanField(
|
||||
default=True, verbose_name='Ask the user consent before forwarding attributes'
|
||||
),
|
||||
),
|
||||
(
|
||||
'allow_attributes_selection',
|
||||
models.BooleanField(
|
||||
default=True, verbose_name='Allow the user to select the forwarding attributes'
|
||||
),
|
||||
),
|
||||
(
|
||||
'forward_attributes_from_push_sources',
|
||||
models.BooleanField(default=False, verbose_name='Forward pushed attributes'),
|
||||
),
|
||||
(
|
||||
'map_attributes_from_push_sources',
|
||||
models.BooleanField(default=False, verbose_name='Map forwarded pushed attributes'),
|
||||
),
|
||||
(
|
||||
'output_name_format',
|
||||
models.CharField(
|
||||
default=('urn:oasis:names:tc:SAML:2.0:attrname-format:uri', 'SAMLv2 URI'),
|
||||
max_length=100,
|
||||
verbose_name='Output name format',
|
||||
choices=[
|
||||
('urn:oasis:names:tc:SAML:2.0:attrname-format:uri', 'SAMLv2 URI'),
|
||||
('urn:oasis:names:tc:SAML:2.0:attrname-format:basic', 'SAMLv2 BASIC'),
|
||||
],
|
||||
),
|
||||
),
|
||||
(
|
||||
'output_namespace',
|
||||
models.CharField(
|
||||
default=('Default', 'Default'),
|
||||
max_length=100,
|
||||
verbose_name='Output namespace',
|
||||
choices=[
|
||||
('Default', 'Default'),
|
||||
(
|
||||
'http://schemas.xmlsoap.org/ws/2005/05/identity/claims',
|
||||
'http://schemas.xmlsoap.org/ws/2005/05/identity/claims',
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
(
|
||||
'filter_source_of_filtered_attributes',
|
||||
models.BooleanField(
|
||||
default=False,
|
||||
verbose_name='Filter by source and per attribute the forwarded pushed attributes',
|
||||
),
|
||||
),
|
||||
(
|
||||
'map_attributes_of_filtered_attributes',
|
||||
models.BooleanField(default=False, verbose_name='Map filtered attributes'),
|
||||
),
|
||||
(
|
||||
'send_error_and_no_attrs_if_missing_required_attrs',
|
||||
models.BooleanField(
|
||||
default=False, verbose_name='Send an error when a required attribute is missing'
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'attribute policy',
|
||||
'verbose_name_plural': 'attribute policies',
|
||||
},
|
||||
bases=(models.Model,),
|
||||
),
|
||||
]
|
|
@ -1,7 +0,0 @@
|
|||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
('idp', '0001_initial'),
|
||||
]
|
|
@ -1,14 +0,0 @@
|
|||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
('saml', '0016_auto_20150915_2041'),
|
||||
('idp', '0002_auto_20150526_2239'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.DeleteModel(
|
||||
name='AttributePolicy',
|
||||
),
|
||||
]
|
|
@ -1,23 +0,0 @@
|
|||
# authentic2 - versatile identity manager
|
||||
# Copyright (C) 2010-2019 Entr'ouvert
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify it
|
||||
# under the terms of the GNU Affero General Public License as published
|
||||
# by the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from django.urls import re_path
|
||||
|
||||
from authentic2.idp.interactions import consent_federation
|
||||
|
||||
urlpatterns = [
|
||||
re_path(r'^consent_federation', consent_federation, name='a2-consent-federation'),
|
||||
]
|
|
@ -8,7 +8,6 @@ import authentic2.saml.models
|
|||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
('custom_user', '__first__'),
|
||||
('idp', '__first__'),
|
||||
('contenttypes', '0001_initial'),
|
||||
]
|
||||
|
||||
|
@ -474,17 +473,6 @@ class Migration(migrations.Migration):
|
|||
'users_can_manage_federations',
|
||||
models.BooleanField(default=True, verbose_name='users can manage federation'),
|
||||
),
|
||||
(
|
||||
'attribute_policy',
|
||||
models.ForeignKey(
|
||||
related_name='attribute_policy',
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
verbose_name='attribute policy',
|
||||
blank=True,
|
||||
to='idp.AttributePolicy',
|
||||
null=True,
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'SAML service provider',
|
||||
|
|
|
@ -56,10 +56,6 @@ class Migration(migrations.Migration):
|
|||
migrations.DeleteModel(
|
||||
name='LibertyIdentityProvider',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='libertyserviceprovider',
|
||||
name='attribute_policy',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='libertyserviceprovider',
|
||||
name='enable_following_attribute_policy',
|
||||
|
|
|
@ -153,7 +153,6 @@ INSTALLED_APPS = (
|
|||
'authentic2_idp_oidc',
|
||||
'authentic2.nonce',
|
||||
'authentic2.saml',
|
||||
'authentic2.idp',
|
||||
'authentic2.idp.saml',
|
||||
'authentic2.disco_service',
|
||||
'authentic2.manager',
|
||||
|
|
|
@ -107,7 +107,6 @@ urlpatterns = [
|
|||
re_path(r'^su/(?P<uuid>[A-Za-z0-9_-]+)/$', views.su, name='su'),
|
||||
path('accounts/', include(accounts_urlpatterns)),
|
||||
re_path(r'^admin/', admin.site.urls),
|
||||
path('idp/', include('authentic2.idp.urls')),
|
||||
path('manage/', include('authentic2.manager.urls')),
|
||||
path('api/', include('authentic2.api_urls')),
|
||||
path('continue/', views.display_message_and_continue, name='continue'),
|
||||
|
|
Loading…
Reference in New Issue