Skip to content

Commit

Permalink
Add demo configuration option in config.php to be able to switch betw…
Browse files Browse the repository at this point in the history
…een irma-demo and pbdf issuers.
  • Loading branch information
Maja Reissner committed Feb 26, 2021
1 parent 9ea6b57 commit c01c508
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
13 changes: 11 additions & 2 deletions config.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
<?php

define('IRMA_SERVER_URL', 'http://localhost:8088');
define('BASE_URL', 'https://privacybydesign.foundation');
define('IRMATUBE_NEXT_SESSION_URL', BASE_URL . '/demo/get_session_request.php');
define('API_TOKEN', '');
define('DEMO', false);

if (DEMO) {
define('ISSUER', 'irma-demo');
define('BASE_URL', 'http://localhost');
define('IRMATUBE_NEXT_SESSION_URL', BASE_URL . '/build/nl/get_session_request.php');
} else {
define('ISSUER', 'pbdf');
define('BASE_URL', 'https://privacybydesign.foundation');
define('IRMATUBE_NEXT_SESSION_URL', BASE_URL . '/demo/get_session_request.php');
}
2 changes: 1 addition & 1 deletion get_session_request.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function get_session_request($contents) {
$sessionrequest = [
'@context' => 'https://irma.app/ld/request/issuance/v2',
'credentials' => [[
'credential' => 'irma-demo.IRMATube.member',
'credential' => ISSUER . '.IRMATube.member',
'validity' => strtotime('+6 months'),
'attributes' => [
'fullname' => $parsedjson['disclosed'][0][0]['rawvalue'],
Expand Down
6 changes: 3 additions & 3 deletions start_session.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,16 +134,16 @@
'@context' => 'https://irma.app/ld/request/disclosure/v2',
'disclose' => [
[
['pbdf.pbdf.facebook.fullname'],
['pbdf.gemeente.personalData.fullname'],
[ISSUER .'.pbdf.facebook.fullname'],
[ISSUER .'.gemeente.personalData.fullname'],
]
],
]
],
'watch_premium_contents' => [
'@context' => 'https://irma.app/ld/request/disclosure/v2',
'disclose' => [[[
'pbdf.IRMATube.member.fullname',
ISSUER .'.IRMATube.member.fullname',
]]],
],
'presencecheck' => [
Expand Down

0 comments on commit c01c508

Please sign in to comment.