From dc37c64cde52f0dbdbeb3fd43705bc002668e9f5 Mon Sep 17 00:00:00 2001 From: Ivar Derksen Date: Wed, 7 Aug 2019 16:35:59 +0200 Subject: [PATCH] Added student and signature demo --- build_artifacts.sh | 1 + mail/index.en.html | 4 +- mail/index.nl.html | 2 +- mail/maildemo.en.js | 70 ++++++++--------- mail/maildemo.nl.js | 70 ++++++++--------- signature/index.en.html | 146 ++++++++++++++++++++++++++++++++++ signature/index.nl.html | 160 ++++++++++++++++++++++++++++++++++++++ signature/sign.en.js | 11 +++ signature/sign.nl.js | 11 +++ signature/sign_ex.css | 9 +++ signature/sign_ex.js | 52 +++++++++++++ start_session.js | 10 +-- start_session.php | 18 +++-- student/index.en.html | 110 ++++++++++++++++++++++++++ student/index.nl.html | 108 +++++++++++++++++++++++++ student/studentdemo.en.js | 44 +++++++++++ student/studentdemo.nl.js | 44 +++++++++++ 17 files changed, 784 insertions(+), 86 deletions(-) create mode 100644 signature/index.en.html create mode 100644 signature/index.nl.html create mode 100644 signature/sign.en.js create mode 100644 signature/sign.nl.js create mode 100644 signature/sign_ex.css create mode 100644 signature/sign_ex.js create mode 100644 student/index.en.html create mode 100644 student/index.nl.html create mode 100644 student/studentdemo.en.js create mode 100644 student/studentdemo.nl.js diff --git a/build_artifacts.sh b/build_artifacts.sh index 6c20e2b..a4dd164 100755 --- a/build_artifacts.sh +++ b/build_artifacts.sh @@ -8,6 +8,7 @@ DIR=$(dirname "$0") mkdir -p "$DIR/assets" cp "$DIR/node_modules/jquery/dist/jquery.min.js" "$DIR/assets/jquery.min.js" cp "$DIR/node_modules/bootstrap/dist/css/bootstrap.min.css" "$DIR/assets/bootstrap.min.css" +cp "$DIR/node_modules/bootstrap/dist/js/bootstrap.min.js" "$DIR/assets/bootstrap.min.js" cp "$DIR/node_modules/@privacybydesign/irmajs/dist/irma.js" "$DIR/assets/irma.js" rm -rf "$DIR/build" diff --git a/mail/index.en.html b/mail/index.en.html index 51ba165..e8234f0 100644 --- a/mail/index.en.html +++ b/mail/index.en.html @@ -13,7 +13,7 @@ -
+

Demo: verification of e-mail address with IRMA

@@ -49,7 +49,7 @@

Demo: verification of e-mail address with IRMA

issuance webpage of the Privacy by Design foundation.

-
+
diff --git a/mail/index.nl.html b/mail/index.nl.html index 4bfb949..b38e2b3 100644 --- a/mail/index.nl.html +++ b/mail/index.nl.html @@ -13,7 +13,7 @@ -
+

Demo: controle van e-mail adres met IRMA

diff --git a/mail/maildemo.en.js b/mail/maildemo.en.js index 30b2c17..9469ba9 100644 --- a/mail/maildemo.en.js +++ b/mail/maildemo.en.js @@ -1,44 +1,42 @@ $.getScript("../start_session.js", function() { - $(function () { - let successgmail_fun = function (data) { - let email = data.disclosed[0][0].rawvalue; - let email_len = email.length; - let email_tail = email.substr(email_len - 9, email_len); - if (email_tail === "gmail.com") { - $("#main").html("

Email verification succeeded!

You have revealed a gmail.com address, which allows you to proceed, for instance to Gmail

Back

"); - } else { - $("#main").html("

Email verification failed!

You do not have a gmail.com address, but:   " - + email + "


Back

"); - } - }; + let successgmail_fun = function (data) { + let email = data.disclosed[0][0].rawvalue; + let email_len = email.length; + let email_tail = email.substr(email_len - 9, email_len); + if (email_tail === "gmail.com") { + $("#main").html("

Email verification succeeded!

You have revealed a gmail.com address, which allows you to proceed, for instance to Gmail

Back

"); + } else { + $("#main").html("

Email verification failed!

You do not have a gmail.com address, but:   " + + email + "


Back

"); + } + }; - let successemail_fun = function (data) { - let email = data.disclosed[0][0].rawvalue; - $("#main").html("

Email disclosure succeeded!

You have revealed e-mail address:   " - + email + - "


Back

"); - }; + let successemail_fun = function (data) { + let email = data.disclosed[0][0].rawvalue; + $("#main").html("

Email disclosure succeeded!

You have revealed e-mail address:   " + + email + + "


Back

"); + }; - let cancelled_fun = function() { - $("#result_status") - .html("Email verification cancelled.") - .addClass("alert alert-warning") - .css("font-weight", "bold"); - } + let cancelled_fun = function() { + $("#result_status") + .html("Email verification cancelled.") + .addClass("alert alert-warning") + .css("font-weight", "bold"); + } - let error_fun = function (data) { - $("#result_status") - .html("Email verification failed!") - .addClass("alert alert-danger") - .css("font-weight", "bold"); - }; + let error_fun = function (data) { + $("#result_status") + .html("Email verification failed!") + .addClass("alert alert-danger") + .css("font-weight", "bold"); + }; - $('#try_irma_gmailbtn').click(function () { - start_session('gmail', 'en', successgmail_fun, cancelled_fun, error_fun); - }); + $('#try_irma_gmailbtn').click(function () { + start_session('gmail', 'en', successgmail_fun, cancelled_fun, error_fun); + }); - $('#try_irma_emailbtn').click(function () { - start_session('email', 'en', successemail_fun, cancelled_fun, error_fun); - }); + $('#try_irma_emailbtn').click(function () { + start_session('email', 'en', successemail_fun, cancelled_fun, error_fun); }); }); diff --git a/mail/maildemo.nl.js b/mail/maildemo.nl.js index a3e05a3..d4828f1 100644 --- a/mail/maildemo.nl.js +++ b/mail/maildemo.nl.js @@ -1,44 +1,42 @@ $.getScript("../start_session.js", function () { - $(function () { - let successgmail_fun = function (data) { - let email = data.disclosed[0][0].rawvalue; - let email_len = email.length; - let email_tail = email.substr(email_len - 9, email_len); - if (email_tail === "gmail.com") { - $("#main").html("

Email controle is geslaagd!

U heeft een gmail.com adres getoond en kunt daarmee verder, bijvoorbeeld naar Gmail

Terug

"); - } else { - $("#main").html("

Email controle is niet geslaagd!

U heeft geen gmail.com adres, maar wel:   " - + email + "


Terug

"); - } - }; + let successgmail_fun = function (data) { + let email = data.disclosed[0][0].rawvalue; + let email_len = email.length; + let email_tail = email.substr(email_len - 9, email_len); + if (email_tail === "gmail.com") { + $("#main").html("

Email controle is geslaagd!

U heeft een gmail.com adres getoond en kunt daarmee verder, bijvoorbeeld naar Gmail

Terug

"); + } else { + $("#main").html("

Email controle is niet geslaagd!

U heeft geen gmail.com adres, maar wel:   " + + email + "


Terug

"); + } + }; - let successemail_fun = function (data) { - let email = data.disclosed[0][0].rawvalue; - $("#main").html("

Email opvraag is geslaagd!

U heeft het email adres:   " - + email + - "


Terug

"); - }; + let successemail_fun = function (data) { + let email = data.disclosed[0][0].rawvalue; + $("#main").html("

Email opvraag is geslaagd!

U heeft het email adres:   " + + email + + "


Terug

"); + }; - let cancelled_fun = function () { - $("#result_status") - .html("Email check geannuleerd.") - .addClass("alert alert-warning") - .css("font-weight", "bold"); - }; + let cancelled_fun = function () { + $("#result_status") + .html("Email check geannuleerd.") + .addClass("alert alert-warning") + .css("font-weight", "bold"); + }; - let error_fun = function (data) { - $("#result_status") - .html("Email check mislukt!") - .addClass("alert alert-danger") - .css("font-weight", "bold"); - }; + let error_fun = function (data) { + $("#result_status") + .html("Email check mislukt!") + .addClass("alert alert-danger") + .css("font-weight", "bold"); + }; - $('#try_irma_gmailbtn').click(function () { - start_session('gmail', 'nl', successgmail_fun, cancelled_fun, error_fun); - }); + $('#try_irma_gmailbtn').click(function () { + start_session('gmail', 'nl', successgmail_fun, cancelled_fun, error_fun); + }); - $('#try_irma_emailbtn').click(function () { - start_session('email', 'nl', successemail_fun, cancelled_fun, error_fun); - }); + $('#try_irma_emailbtn').click(function () { + start_session('email', 'nl', successemail_fun, cancelled_fun, error_fun); }); }); diff --git a/signature/index.en.html b/signature/index.en.html new file mode 100644 index 0000000..08ba02e --- /dev/null +++ b/signature/index.en.html @@ -0,0 +1,146 @@ + + + IRMA Signing + + + + + + + + + + + + + +
+

Digital signatures with IRMA: some sign-by-QR + examples

+

+ On this page you can try out some examples in + which you can produce digital signatures + yourself, with the attributes in your IRMA + app. After pressing the buttons below, a signing + request appears in your IRMA app. When you read + this page on your phone, the switch to the IRMA + app is made automatically. When you read this + page on another device, you should first scan + the the QR code that appears, using the IRMA app + on your phone. +

+

+ None of these example leads to actual + obligations. You can safely perform these + signing acts. The example text that you sign + does not commit you and the resulting signature + is not stored. +

+

+ In order to be able to try out these examples + you must have collected the relevant attributes + in your IRMA app. This can be done via the + IRMA issuance + page. +

+ +
+ + +
+
+

+ +

+
+

+ Now you are asked to sign that you will + contribute financially to the foundation + (not really). You sign with your family + name and with your mobile phone number + attributes. +

+
+
+ +
+
+

+ +

+
+

+ Here you are asked to sign as teacher that + a certain student has passed your exam. You + sign with three SURF attributes, viz. your + name, the (educational) institution where + you work, and your email address at that + institution. +

+
+
+
+ +

+ Attribute-based digital signatures offer many + new possibilities: a police officer, for + instance, can sign a report with his/her name + and police-registration number, as IRMA + attributes; in this way the integrity and + authenticity of this report is guaranteed in the + whole criminal justice chain. Also, a medical + doctor can sign a medical statement with his/her + own medical credentials as IRMA attributes, so + that everyone can verify that this statement is + actually signed by a medical doctor (and also by + whom). Within organisations all kinds of + decisions can be registered reliably and + verifiably with digital signatures. IRMA is the + only identity platform that seamlessly combines + both authentication and signing. +

+

+ Back + to the IRMA demo page. +

+
+ + diff --git a/signature/index.nl.html b/signature/index.nl.html new file mode 100644 index 0000000..114b0a1 --- /dev/null +++ b/signature/index.nl.html @@ -0,0 +1,160 @@ + + + IRMA Ondertekening + + + + + + + + + + + + + +
+

Digitale handtekeningen met IRMA: enkele sign-by-QR voorbeelden

+

+ Op deze pagina kunt u enkele voorbeelden + uitproberen waarbij u zelf een digitale + handtekening zet met eigen attributen in de IRMA + app. Na het drukken op een van de onderstaande + knoppen verschijnt een ondertekeningsverzoek in + uw IRMA app. Wanneer u deze pagina op uw + telefoon bekijkt, wordt automatisch + overgeschakeld naar de IRMA app. Wanneer u deze + pagina op een andere apparaat bekijkt moet u + eerst de QR code die verschijnt met de IRMA app + op uw telefoon scannen. +

+

+ Geen enkele van deze voorbeelden leidt tot + daadwerkelijke verplichtingen. U kunt dus gerust + de ondertekening geheel uitvoeren. De tekst die + u ondertekent is niet verplichtend en wordt niet + bewaard. +

+

+ Voor het succesvol uitproberen van deze + voorbeelden is het vereist dat u de benodigde + attributen reeds in uw IRMA app verzameld + heeft. Dat kan via de + IRMA uitgifte + pagina. +

+ +
+ + +
+
+

+ +

+
+

+ Hierbij wordt u gevraagd te ondertekenen + dat u een financiƫle bijdrage zult leveren + aan de stichting (niet echt). U + ondertekent hierbij met uw achternaam en + met uw mobiele telefoonnummer attributen. +

+
+
+ +
+
+

+ +

+
+

+ Hierbij wordt u gevraagd om als docent te + ondertekenen dat een bepaalde student + geslaagd is voor uw tentamen. U + ondertekent hierbij met een drietal SURF + attributen, namelijk uw naam, de + (educatieve) instelling waar u werkzaam + bent, en met uw email adres bij die + instelling. Een mogelijkheid is om deze + functionaliteit te integreren met het veel + gebruikte administratie + systeem Osiris, + zodat docenten geen natte handtekeningen + meer hoeven te zetten op lijsten met + tentamencijfers. +

+
+
+
+ +

+ Attribuut-gebaseerde digitale handtekeningen + bieden veel nieuwe mogelijkheden: een + politiebeambte kan bijv. een proces verbaal + ondertekenen met zijn/haar naam en + politie-registratienummer, als IRMA attributen; + daarmee wordt de integreteit en authenticiteit + van dit proces verbaal in de hele verdere + justitiële keten gegarandeerd. Ook kan een + arts een medische verklaring met de + eigen BIG-registratie + gegevens als IRMA attributen ondertekenen, zodat + iedereen kan controleren dat deze verklaring + daadwerkelijk door een arts (en ook welke) + getekend is. Binnen organisaties kunnen allerlei + beslissingen met digitale handtekeningen + betrouwbaar en controleerbaar vastgelegd + worden. IRMA is het enige + identity platform dat dergelijke + geïntegreerde authenticatie en + ondertekening biedt. +

+

+ Terug naar + het IRMA demo overzicht. +

+
+ + diff --git a/signature/sign.en.js b/signature/sign.en.js new file mode 100644 index 0000000..4e16301 --- /dev/null +++ b/signature/sign.en.js @@ -0,0 +1,11 @@ +'use strict'; + +var MESSAGES = { + 'lang': 'en', + 'cancel-message': 'Cancelled', + 'error': 'Error', + 'errormsg': 'Error message', + 'email-success': '
Consent signing succeeded! You have signed the following message with email address :
', + 'donation-success': '
Signing of the donation succeeded! You have signed the following message with name and phone number
', + 'exam-success': '
Signing of the exam outcome succeeded! You have signed the following message as with name from the institute with email address
', +}; diff --git a/signature/sign.nl.js b/signature/sign.nl.js new file mode 100644 index 0000000..335682a --- /dev/null +++ b/signature/sign.nl.js @@ -0,0 +1,11 @@ +'use strict'; + +var MESSAGES = { + 'lang': 'nl', + 'cancel-message': 'Geannuleerd', + 'error': 'Fout', + 'errormsg': 'Foutmelding', + 'email-success': '
Ondertekening van toestemming is geslaagd! U heeft het volgende bericht ondertekend met e-mail adres :
', + 'donation-success': '
Ondertekening van donatie is geslaagd! U heeft het volgende bericht ondertekend met naam en telefoonnummer
', + 'exam-success': '
Ondertekening van tentamen uitslag is geslaagd! U heeft het volgende bericht ondertekend met naam , als verbonden aan het instituut met email adres
', +}; diff --git a/signature/sign_ex.css b/signature/sign_ex.css new file mode 100644 index 0000000..3ca2fe2 --- /dev/null +++ b/signature/sign_ex.css @@ -0,0 +1,9 @@ + +/* A bit of a hack, but it looks nice. */ +.tab-content { + border-left: 1px solid #ddd; + border-right: 1px solid #ddd; + border-bottom: 1px solid #ddd; + padding: 10px; + margin-bottom: 10px; +} diff --git a/signature/sign_ex.js b/signature/sign_ex.js new file mode 100644 index 0000000..3eee565 --- /dev/null +++ b/signature/sign_ex.js @@ -0,0 +1,52 @@ +'use strict'; + +$.getScript("../start_session.js", function() { + function setupSignButton(button, resultStatus, reqName, successMessageFunc) { + let onSuccess = function(data) { + resultStatus.html('
'); + $('.prefix', resultStatus).html(successMessageFunc(data.disclosed).html()); + $('.signedText', resultStatus).html(data.signature.message); + }; + let onCancel = function() { + resultStatus.html('
'); + $('div', resultStatus).text(MESSAGES['cancel-message']); + }; + let onError = function(data) { + resultStatus.html('

:

'); + $('.error', resultStatus).text(MESSAGES['error']); + $('.errormsg', resultStatus).text(MESSAGES['errormsg']); + $('.data', resultStatus).text(data); + }; + + button.click(function() { + start_session(reqName, MESSAGES['lang'], onSuccess, onCancel, onError); + }); + } + + // Email + setupSignButton($('#btn_email_consent'), $('#email_consent_result_status'), 'email-signature', function (attributes) { + let message = $(MESSAGES['email-success']); + $('.attribute.email', message).text(attributes[0][0].rawvalue); + return message; + }); + + // Donation + setupSignButton($('#btn_donation'), $('#donation_result_status'), 'donation-signature', function(attributes) { + let name = attributes[0][0].rawvalue; + let number = attributes[1][0].rawvalue; + let el = $(MESSAGES['donation-success']); + $('.attribute.name', el).text(name); + $('.attribute.number', el).text(number); + return el; + }); + + // Exam + setupSignButton($('#btn_exam'), $('#exam_result_status'), 'exam-signature', function(attributes) { + let el = $(MESSAGES['exam-success']); + $('.attribute.name', el).text(attributes[0][0].rawvalue); + $('.attribute.institute', el).text(attributes[0][1].rawvalue); + $('.attribute.email', el).text(attributes[0][2].rawvalue); + $('.attribute.employee', el).text(attributes[0][3].rawvalue); + return el; + }); +}); diff --git a/start_session.js b/start_session.js index 03575ae..7743438 100644 --- a/start_session.js +++ b/start_session.js @@ -1,24 +1,24 @@ function start_session(type, lang, success_fun, cancelled_fun, error_fun) { console.log("Button clicked"); - $.get('../start_session.php?type=' + type, function(sessionpackagejson) { + $.get('../start_session.php?type=' + type + '&lang=' + lang, function(sessionpackagejson) { let sessionpackage = JSON.parse(sessionpackagejson); console.log(sessionpackage); let options = {server: sessionpackage.sessionPtr.u.split('/irma')[0], token: sessionpackage.token, language: lang}; let promise = irma.handleSession(sessionpackage.sessionPtr, options); let success = function (data) { - console.log("Authentication successful!"); - console.log("Authentication token:", data); + console.log("Session successful!"); + console.log("Result:", data); success_fun(data); }; let error = function(data) { if(data === 'CANCELLED') { - console.log("Authentication cancelled!"); + console.log("Session cancelled!"); cancelled_fun(data); } else { - console.log("Authentication failed!"); + console.log("Session failed!"); console.log("Error data:", data); error_fun(data); } diff --git a/start_session.php b/start_session.php index 40daa04..33b8b57 100644 --- a/start_session.php +++ b/start_session.php @@ -39,6 +39,7 @@ 'disclose' => [ [ ['pbdf.pbdf.idin.familyname'], + ['pbdf.nijmegen.personalData.familyname'], ['pbdf.pbdf.facebook.familyname'], ['pbdf.pbdf.linkedin.familyname'], ['pbdf.pbdf.twitter.fullname'], @@ -118,8 +119,7 @@ ], ]; -function start_session($type, $lang) -{ +function start_session($type, $lang) { global $sprequests, $sigrequests, $protocol; if (array_key_exists($type, $sprequests)) @@ -142,22 +142,28 @@ function start_session($type, $lang) ); $resp = file_get_contents(IRMA_SERVER_URL . '/session', false, stream_context_create($api_call)); + if (! $resp) { + error(); + } return $resp; } function get_signature_request($type, $lang) { global $sigrequests; - if ( !array_key_exists($type, $sigrequests) || !array_key_exists($lang, $sigrequests[$type]) ) - stop(); - $request = $sigrequests[$type]; - // Signature requests do not support translatable strings + // Signature requests do not support translatable strings, use chosen language $request['message'] = $sigrequests[$type]['message'][$lang]; return $request; } +function error() { + http_response_code(500); + echo 'Internal server error'; + exit(); +} + function stop() { http_response_code(400); echo 'Invalid request'; diff --git a/student/index.en.html b/student/index.en.html new file mode 100644 index 0000000..06dd285 --- /dev/null +++ b/student/index.en.html @@ -0,0 +1,110 @@ + + + + + + Student IRMA demo + + + + + + + + + +
+ +

Demo: student verification with IRMA

+ +
+ +

+This page contains an example of using IRMA for verifying whether +someone is a student or not. Additionally, the page explains how this +works and how this can be used for instance by webshops that wish to +give special offers to students. The first button below can be used to +check if a visitor actually is a student. The special point of IRMA is +its privacy-friendliness: the visitor discloses no other information +than the mere fact that (s)he is a student. This "student" property +exists as a special IRMA attribute; only the yes/no information in +this attribute is revealed to the requesting webpage. +

+ +

+Via the second button it is possible to request additional +information, namely the role of the visitor (student or employee) and +the name of the university (or educational institute) with which the +student/employee is associated. In this way exclusive access can be +organised for students and/or employees of a particular institute. +

+ + +

+In order to be able to try out yourself the buttons below one needs to +have the IRMA +app installed +with at least the student attribute loaded. This can be done +via SURFconext +issuance webpage of the Privacy by Design foundation. A succesful +check that the visitor is a student gives access to special offers. +

+ +
+ + + + +    + + + + + +
+ + +

+A few remarks: +

    +
  • There are several websites +(like Amazon) that +offer discounts to students. How they actually check that someone is a +student is not always clear. With IRMA this can now be done in an +easy, reliable and privacy-friendly manner. + +
  • Via SURFconext email addresses are available too as IRMA +attributes. They are not used in this demo in order to avoid +identifying data. + +
  • At this stage this attribute issuance is available only for +students and staff members of a limited number of institutions in +higher eduction in the Netherlands. Are you studying or working at +such an institution but does your institution not occur in the list at +the SURFconext +issuance page? This means that your institution has not "switched +on" the connection to the foundation Privacy by Design. In that case +you cannot receive attributes via SURFconext. The best thing that you +can do is to contact locally at your institution the people +responsible for computer support (in particular: identity management) +and ask them to send an email to the +address support'at'surfconext.nl, with the simple request: +Please give the Privacy by Design foundation access as Service +Provider to our institution (in Dutch: AUB de stichting Privacy by +Design voor onze instelling toelaten als Service Provider). +
+

+ +

+Back to +the IRMA demo overview. +

+ +
+ +
+ +
+ + + diff --git a/student/index.nl.html b/student/index.nl.html new file mode 100644 index 0000000..2db78d4 --- /dev/null +++ b/student/index.nl.html @@ -0,0 +1,108 @@ + + + + + + Student IRMA demo + + + + + + + + + +
+ +

Demo: studentcontrole met IRMA

+ +
+ +

+Deze pagina bevat een voorbeeld om met IRMA na te gaan of iemand een +student is. Verder wordt uitgelegd hoe dit werkt en hoe dit gebruikt +kan worden bijvoorbeeld door webwinkels die speciale aanbiedingen +willen geven aan studenten. Met de onderstaande eerste knop kan +gecontroleerd worden of een bezoeker van zo'n webpagina daadwerkelijk +student is. Het bijzondere aan IRMA is de privacy-vriendelijkheid: de +bezoeker onthult geen enkele andere informatie dan het feit dat +hij/zij student is. Voor deze eigenschap "student" bestaat namelijk +een speciaal IRMA attribuut; alleen de ja/nee informatie in dat +attribuut wordt aan de webpagina getoond. +

+ +

+Het is mogelijk om via de tweede knop aanvullende informatie te +vragen, namelijk de rol van de bezoeker (student of medewerker) en de +naam van de instelling (universiteit of hogeschool) waar de student of +medewerker aan verbonden is. Hiermee kan bijvoorbeeld speciale toegang +georganiseerd worden alleen voor studenten en/of medewerkers van een +bepaalde instelling. +

+ + +

+Om de onderstaande knoppen te kunnen uitproberen moet de bezoeker de +IRMA app geïnstalleerd hebben en daarin tenminste +het student attribuut geladen hebben. Dat kan via +de SURFconext +uitgifte webpagina van de stichting Privacy by Design. Succesvolle +controle dat de bezoeker student is geeft vervolgens toegang tot +aanbiedingen. +

+ +
+ + + + +    + + + + + +
+ + +

+Een paar opmerkingen: +

    +
  • Nu al zijn er +verschillende (web)winkels +die kortingen geven aan studenten. Hoe je daar (online) moet bewijzen +dat je daadwerkelijk student bent is niet duidelijk. Met IRMA kan dat +nu op eenvoudige, betrouwbare en privacy-vriendelijke wijze. + +
  • Via SURFconext is ook een email adres beschikbaar. Dat wordt hier +in deze demo niet gebruikt om identificerende gegevens te vermijden. + +
  • Studeert of werkt u aan een hogere onderwijs instelling, maar +komt deze instelling niet voor in de lijst op +de SURFconext +uitgifte pagina, dan heeft uw instelling de aansluiting met de +stichting Privacy by +Design niet "aangezet". In dat geval kunt u de hier benodigde +attributen niet ontvangen. Het beste kunt u dan met het centrale +systeembeheer van de eigen instelling contact opnemen en de +verantwoordelijke voor identity management vragen een email te sturen +naar het adres support'at'surfconext.nl, met het simpele +verzoek: AUB de stichting Privacy by Design voor onze instelling +toelaten als Service Provider. +
+

+ +

+Terug naar +het IRMA demo overzicht. +

+ +
+ +
+ +
+ + + diff --git a/student/studentdemo.en.js b/student/studentdemo.en.js new file mode 100644 index 0000000..e21662a --- /dev/null +++ b/student/studentdemo.en.js @@ -0,0 +1,44 @@ +$.getScript("../start_session.js", function() { + let successstudent_fun = function (data) { + let result = data.disclosed[0][0].rawvalue; + if (result === "student") { + $("#main").html('

Student verification succeeded!

For special offers, in Dutch, go to: (web)winkels


Back

'); + } else { + $("#main").html('

Student verification failed!


Back

'); + } + }; + + + let successschool_fun = function (data) { + let role = data.disclosed[0][0].rawvalue; + let school = data.disclosed[0][1].rawvalue; + $("#main").html('

Attribute verification succeeded!

You are ' + + role + + " at the institution with abbreviation: " + + school + + "


" + + "

Back

"); + }; + + var cancel_fun = function (data) { + $("#result_status") + .html("student verification cancelled.") + .addClass("alert alert-warning") + .css("font-weight", "bold"); + }; + + var error_fun = function (data) { + $("#result_status") + .html("student verification failed!") + .addClass("alert alert-danger") + .css("font-weight", "bold"); + }; + + $('#try_irma_studentbtn').click(function () { + start_session('student', 'en', successstudent_fun, cancel_fun, error_fun); + }); + + $('#try_irma_studentschoolbtn').click(function () { + start_session('school', 'en', successschool_fun, cancel_fun, error_fun); + }); +}); diff --git a/student/studentdemo.nl.js b/student/studentdemo.nl.js new file mode 100644 index 0000000..4ac1720 --- /dev/null +++ b/student/studentdemo.nl.js @@ -0,0 +1,44 @@ +$.getScript("../start_session.js", function() { + var successstudent_fun = function(data) { + if (data.disclosed[0][0].rawvalue === "student") { + $("#main").html('

Student controle geslaagd!

Voor aanbiedingen, ga naar: (web)winkels


Terug

'); + } + else { + $("#main").html('

Student controle niet geslaagd!


Terug

'); + } + }; + + + let successschool_fun = function(data) { + let role = data.disclosed[0][0].rawvalue; + let school = data.disclosed[0][1].rawvalue; + $("#main").html('

Attribuut controle is geslaagd!

U bent ' + + role + + " aan de instelling met afkorting " + + school + + "


" + + "

Terug

"); + }; + + let cancel_fun = function(data) { + $("#result_status") + .html("student check geannulleerd.") + .addClass("alert alert-warning") + .css("font-weight", "bold"); + }; + + let error_fun = function(data) { + $("#result_status") + .html("student check mislukt!") + .addClass("alert alert-danger") + .css("font-weight", "bold"); + }; + + $('#try_irma_studentbtn').click(function () { + start_session('student', 'nl', successstudent_fun, cancel_fun, error_fun); + }); + + $('#try_irma_studentschoolbtn').click(function () { + start_session('school', 'nl', successschool_fun, cancel_fun, error_fun); + }); +});