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


##########
plugins/user-authenticators/oauth2/src/main/java/org/apache/cloudstack/oauth2/OAuth2AuthManagerImpl.java:
##########
@@ -219,6 +236,38 @@ public boolean deleteOauthProvider(Long id) {
         return _oauthProviderDao.remove(id);
     }
 
+    @Override
+    public Long resolveDomainId(Map<String, Object[]> params) {
+        final String[] domainIdArray = 
(String[])params.get(ApiConstants.DOMAIN_ID);
+        if (ArrayUtils.isNotEmpty(domainIdArray)) {
+            String domainUuid = domainIdArray[0];
+            if (GLOBAL_DOMAIN_FILTER.equals(domainUuid)) {
+                return GLOBAL_DOMAIN_ID;
+            }
+            DomainVO domain = _domainDao.findByUuid(domainUuid);
+            if (Objects.nonNull(domain)) {
+                return domain.getId();
+            }
+        }

Review Comment:
   check if you can use the below methods, and move get domain by path to a 
method (or can improve any existing method)
   
   
https://github.com/apache/cloudstack/blob/1bff543e58e626a7bcdea265284c8f3bcf57c7b0/server/src/main/java/com/cloud/api/ApiServer.java#L1438
   
   
https://github.com/apache/cloudstack/blob/1bff543e58e626a7bcdea265284c8f3bcf57c7b0/server/src/main/java/com/cloud/api/ApiServer.java#L1184



-- 
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