wolfboys commented on code in PR #2776:
URL:
https://github.com/apache/incubator-streampark/pull/2776#discussion_r1231147979
##########
streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/security/impl/AuthenticatorImpl.java:
##########
@@ -106,4 +111,26 @@ private User ldapAuthenticate(String username, String
password) throws Exception
usersService.createUser(newUser);
return newUser;
}
+
+ private User ssoAuthenticate(String username) throws Exception {
+ // check if user exist
+ User user = usersService.findByName(username);
+ if (user != null) {
+ if (user.getLoginType() != LoginType.SSO) {
+ throw new ApiAlertException(
+ String.format("user [%s] can only sign in with %s", username,
user.getLoginType()));
+ }
+ return user;
+ }
+ User newUser = new User();
Review Comment:
We can improve this code. see
[here](https://github.com/apache/incubator-streampark/blob/dev/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/security/impl/AuthenticatorImpl.java#L97)
--
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]