my @error_events;
my $authenticated = 0;
my $auths;
+ my $barcode_means_native;
+
+ if ($args->{barcode} and $args->{org}) {
+ $barcode_means_native = $U->is_true(
+ $U->ou_ancestor_setting_value($args->{org}, 'auth_proxy.native_login_with_barcode')
+ );
+ if ($barcode_means_native) {
+ if (exists $authenticators_by_name{'native'}) {
+ $auths = [$authenticators_by_name{'native'}];
+ } else {
+ $logger->debug("Ignoring AuthProxy native login with barcode - native login is not configured");
+ }
+ }
# if they specify an authenticator by name, only try that one
if ($args->{'name'}) {
+ if ($barcode_means_native and $args->{'name'} ne 'native') {
+ $logger->debug("Ignoring AuthProxy native login with barcode - request specified " . $args->{'name'});
+ }
$auths = [$authenticators_by_name{$args->{'name'}}];
} else {
$auths = \@authenticators;
}
+
foreach my $authenticator (@$auths) {
# skip authenticators specified for a different login type
# or org unit id
);
+INSERT into config.org_unit_setting_type (name, label, description, datatype)
+VALUES (
+ 'auth_proxy.native_login_with_barcode',
+ oils_i18n_gettext(
+ 'auth_proxy.native_login_with_barcode',
+ 'AuthProxy: Use native login with barcode',
+ 'coust', 'label'
+ ),
+ oils_i18n_gettext(
+ 'auth_proxy.native_login_with_barcode',
+ 'When using barcode to login, native EG login will be used instead of any configured authentication proxy, unless the login request specifies otherwise.',
+ 'coust', 'description'
+ ),
+ 'bool'
+);
+
--- /dev/null
+BEGIN;
+
+SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+
+INSERT into config.org_unit_setting_type (name, label, description, datatype)
+VALUES (
+ 'auth_proxy.native_login_with_barcode',
+ oils_i18n_gettext(
+ 'auth_proxy.native_login_with_barcode',
+ 'AuthProxy: Use native login with barcode',
+ 'coust', 'label'
+ ),
+ oils_i18n_gettext(
+ 'auth_proxy.native_login_with_barcode',
+ 'When using barcode to login, native EG login will be used instead of any configured authentication proxy, unless the login request specifies otherwise.',
+ 'coust', 'description'
+ ),
+ 'bool'
+);
+
+COMMIT;
+