diff --git a/config.php b/config.php index 5608497..a26a4cd 100644 --- a/config.php +++ b/config.php @@ -4,14 +4,16 @@ 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'); + 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 ac6e190..83c66e9 100644 --- a/start_session.php +++ b/start_session.php @@ -141,10 +141,11 @@ 'disclose' => [ array_merge( [ - [ISSUER .'.pbdf.linkedin.familyname'], - [ISSUER .'.gemeente.personalData.fullname'], + [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