Skip to content

Commit

Permalink
Use file presence to enable OIDC plugin
Browse files Browse the repository at this point in the history
Add ability to activate the OIDC plugin by creating an empty file called
'activate-oidc-plugin' in the AtoM root dir. If this file is present,
the OIDC plugin will be enabled.

Fix primary provider name in OIDC plugin app.yml files.
  • Loading branch information
sbreker committed Oct 18, 2024
1 parent 1316bf1 commit 0e7d8ec
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions config/ProjectConfiguration.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ public function setup()
'sfPluginAdminPlugin',
];

// Check if the OIDC plugin should be enabled.
$filePath = 'activate-oidc-plugin';
if (file_exists($filePath) && filesize($filePath) === 0) {
$plugins[] = 'arOidcPlugin';
}

$this->enablePlugins($plugins);

$this->dispatcher->connect(
Expand Down
2 changes: 1 addition & 1 deletion docker/etc/oidc/arOidcPlugin/config/app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ all:
- 'roles'
user_matching_source: 'oidc-email'
auto_create_atom_user: true
primary_provider_name: primary
primary_provider_name: demo
provider_query_param_name: secondary
redirect_url: 'http://127.0.0.1:63001/index.php/oidc/login'
logout_redirect_url: 'http://127.0.0.1:63001'
2 changes: 1 addition & 1 deletion test/etc/oidc/arOidcPlugin/config/app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ all:
- 'roles'
user_matching_source: 'oidc-email'
auto_create_atom_user: true
primary_provider_name: primary
primary_provider_name: demo
provider_query_param_name: secondary
redirect_url: 'http://localhost/index.php/oidc/login'
logout_redirect_url: 'http://127.0.0.1'

0 comments on commit 0e7d8ec

Please sign in to comment.