ruanwenjun commented on a change in pull request #8706:
URL: https://github.com/apache/dolphinscheduler/pull/8706#discussion_r821604227



##########
File path: 
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/security/SecurityConfig.java
##########
@@ -66,6 +67,9 @@ public Authenticator authenticator() {
             case LDAP:
                 authenticator = new LdapAuthenticator();
                 break;
+            case SSO:

Review comment:
       ```suggestion
               case CASDOOR_SSO:
   ```

##########
File path: 
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/security/AuthenticationType.java
##########
@@ -26,6 +26,7 @@
 
     PASSWORD(0, "verify via user name and password"),
     LDAP(1, "verify via LDAP server"),
+    SSO(1, "verify via sso provider")

Review comment:
       ```suggestion
       CASDOOR_SSO(2, "verify via casdoor sso provider")
   ```

##########
File path: 
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/security/impl/sso/CasdoorAuthenticator.java
##########
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.dolphinscheduler.api.security.impl.sso;
+
+import org.apache.dolphinscheduler.api.security.impl.AbstractSsoAuthenticator;
+import org.apache.dolphinscheduler.api.service.UsersService;
+import org.apache.dolphinscheduler.common.enums.UserType;
+import org.apache.dolphinscheduler.dao.entity.User;
+import org.casbin.casdoor.entity.CasdoorUser;
+import org.casbin.casdoor.service.CasdoorAuthService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+
+
+public class CasdoorAuthenticator extends AbstractSsoAuthenticator {
+
+    @Autowired
+    private UsersService usersService;
+    @Autowired
+    private CasdoorAuthService casdoorAuthService;
+    @Value("${casdoor.redirect-url}")
+    private String redirectUrl;

Review comment:
       Can these fields be injected? I am not sure, it seems you just use 
constructor to create `CasdoorAuthenticator`.




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