sureshanaparti commented on code in PR #12702:
URL: https://github.com/apache/cloudstack/pull/12702#discussion_r3000099663


##########
plugins/user-authenticators/oauth2/src/main/java/org/apache/cloudstack/oauth2/api/command/ListOAuthProvidersCmd.java:
##########
@@ -118,8 +154,20 @@ public String authenticate(String command, Map<String, 
Object[]> params, HttpSes
             responses.add(r);
         }
 
+        int totalEnabledCount = responses.size();
+        if (!domainRequested && !isAuthenticated) {
+            List<OauthProviderVO> allProviders = 
_oauth2mgr.listOauthProviders(null, null, null);
+            for (OauthProviderVO domainProvider : allProviders) {
+                if (domainProvider.getDomainId() != null && 
domainProvider.isEnabled()
+                        && 
Boolean.TRUE.equals(OAuth2AuthManager.OAuth2IsPluginEnabled.valueInScope(ConfigKey.Scope.Domain,
 domainProvider.getDomainId(), true))

Review Comment:
    config value fetched multiple times, try to optimise



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to