From 1cb491d30ba6d434943a88bfd908956142396af8 Mon Sep 17 00:00:00 2001 From: saravahdatipour Date: Thu, 5 Dec 2024 11:34:50 +0100 Subject: [PATCH 1/2] fix to have desired attribute in chained session (irma-demos-ops) --- config.php | 2 ++ start_session.php | 1 + 2 files changed, 3 insertions(+) diff --git a/config.php b/config.php index 5608497..e328b55 100644 --- a/config.php +++ b/config.php @@ -4,6 +4,8 @@ define('API_TOKEN', getenv('API_TOKEN') ?: ''); define('DEMO', false); define('JWT_ENABLED', getenv('JWT_ENABLED')?: false); +define('DESIRED_ATTRIBUTE_TO_DISCLOSE', getenv('DESIRED_ATTRIBUTE_TO_DISCLOSE') ?: ''); + if (DEMO) { define('ISSUER', 'irma-demo'); diff --git a/start_session.php b/start_session.php index ac6e190..85032bb 100644 --- a/start_session.php +++ b/start_session.php @@ -143,6 +143,7 @@ [ [ISSUER .'.pbdf.linkedin.familyname'], [ISSUER .'.gemeente.personalData.fullname'], + DESIRED_ATTRIBUTE_TO_DISCLOSE ? [ISSUER . DESIRED_ATTRIBUTE_TO_DISCLOSE] : [], ], ISSUER === 'pbdf' ? [ ['pbdf.pilot-amsterdam.idcard.surname'], From 929dbc943aa7d4cb6d1a16abbb6f1833fde71c32 Mon Sep 17 00:00:00 2001 From: saravahdatipour Date: Thu, 5 Dec 2024 11:52:30 +0100 Subject: [PATCH 2/2] fix, issuer should've been scheme manager name --- config.php | 4 ++-- start_session.php | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/config.php b/config.php index e328b55..a26a4cd 100644 --- a/config.php +++ b/config.php @@ -8,12 +8,12 @@ if (DEMO) { - define('ISSUER', 'irma-demo'); + define('SCHEME', 'irma-demo'); define('BASE_URL', 'http://localhost:8080'); define('IRMATUBE_NEXT_SESSION_URL', BASE_URL . '/get_session_request.php'); define('IRMATUBE_CREDENTIAL', 'irma-demo.IRMATube.member'); } else { - define('ISSUER',getenv('ISSUER') ?: 'pbdf'); + define('SCHEME',getenv('SCHEME') ?: 'pbdf'); define('BASE_URL', getenv('BASE_URL') ?: 'https://privacybydesign.foundation'); define('IRMATUBE_NEXT_SESSION_URL',getenv('IRMATUBE_NEXT_SESSION_URL') ?: BASE_URL . '/get_session_request.php'); define('IRMATUBE_CREDENTIAL', getenv('IRMATUBE_CREDENTIAL') ?: 'pbdf.pbdf.irmatube'); diff --git a/start_session.php b/start_session.php index 85032bb..83c66e9 100644 --- a/start_session.php +++ b/start_session.php @@ -141,11 +141,11 @@ 'disclose' => [ array_merge( [ - [ISSUER .'.pbdf.linkedin.familyname'], - [ISSUER .'.gemeente.personalData.fullname'], - DESIRED_ATTRIBUTE_TO_DISCLOSE ? [ISSUER . DESIRED_ATTRIBUTE_TO_DISCLOSE] : [], + [SCHEME .'.pbdf.linkedin.familyname'], + [SCHEME .'.gemeente.personalData.fullname'], + DESIRED_ATTRIBUTE_TO_DISCLOSE ? [SCHEME . DESIRED_ATTRIBUTE_TO_DISCLOSE] : [], ], - ISSUER === 'pbdf' ? [ + SCHEME === 'pbdf' ? [ ['pbdf.pilot-amsterdam.idcard.surname'], ['pbdf.pilot-amsterdam.passport.surname'], ] : [] // These credential types have no equivalent in irma-demo