mark attributes from eID or national register as verified

This commit is contained in:
Frédéric Péters 2016-06-01 15:23:21 +02:00
parent 3936774595
commit 012a683591
2 changed files with 9 additions and 5 deletions

2
debian/control vendored
View File

@ -10,6 +10,6 @@ X-Python-Version: >= 2.6
Package: python-authentic2-auth-fedict
Architecture: all
Depends: ${misc:Depends},
python-authentic2 (>= 2.1.2)
python-authentic2 (>= 2.1.20.1000)
Description: Fedict authentication frontend for Authentic2

View File

@ -67,7 +67,8 @@ class AuthenticAdapter(DefaultAdapter):
for nrn_attribute, user_attribute in attribute_mapping:
try:
Attribute.objects.get(name=user_attribute).set_value(user,
attributes.get(nrn_attribute))
attributes.get(nrn_attribute),
verified=True)
except Attribute.DoesNotExist:
pass
@ -84,7 +85,8 @@ class AuthenticAdapter(DefaultAdapter):
nrn = saml_attributes['egovNRN'][0]
for attr_name in ('niss', 'nrn'):
try:
Attribute.objects.get(name=attr_name).set_value(user, nrn)
Attribute.objects.get(name=attr_name).set_value(user, nrn,
verified=True)
except Attribute.DoesNotExist:
pass
if nrn[:6] == '0000001': # unknown date
@ -92,12 +94,14 @@ class AuthenticAdapter(DefaultAdapter):
else:
# TODO: handle post y2k birthdates
birthdate = '%s/%s/19%s' % (nrn[4:6], nrn[2:4], nrn[:2])
Attribute.objects.get(name='birthdate').set_value(user, birthdate)
Attribute.objects.get(name='birthdate').set_value(user, birthdate,
verified=True)
if int(nrn[6:9]) % 2:
title = 'Monsieur'
else:
title = 'Madame'
Attribute.objects.get(name='title').set_value(user, title)
Attribute.objects.get(name='title').set_value(user, title,
verified=True)
if nrn:
self.provision_from_nrn(user, nrn)