CB-864 Support all auth providers in config mode

This commit is contained in:
Serge Rider
2021-03-27 12:49:07 +03:00
parent e51e24cc48
commit 3a553deaa5
@@ -54,7 +54,12 @@ public class WebServiceAuthImpl implements DBWServiceAuth {
if (CommonUtils.isEmpty(providerId)) {
throw new DBWebException("Missing auth provider parameter");
}
if (!CBApplication.getInstance().isConfigurationMode()) {
boolean configMode = CBApplication.getInstance().isConfigurationMode();
if (configMode || webSession.hasPermission(DBWConstants.PERMISSION_ADMIN)) {
// Admin can authorize in any providers
} else {
// Check enabled auth providers
String[] enabledAuthProviders = CBApplication.getInstance().getAppConfiguration().getEnabledAuthProviders();
if (enabledAuthProviders != null && !ArrayUtils.contains(enabledAuthProviders, providerId)) {
throw new DBWebException("Authentication provider '" + providerId + "' is disabled");
@@ -64,7 +69,6 @@ public class WebServiceAuthImpl implements DBWServiceAuth {
if (authProvider == null) {
throw new DBWebException("Invalid auth provider '" + providerId + "'");
}
boolean configMode = CBApplication.getInstance().isConfigurationMode();
try {
Map<String, Object> providerConfig = Collections.emptyMap();