wolfboys commented on code in PR #1840:
URL:
https://github.com/apache/incubator-streampark/pull/1840#discussion_r996445007
##########
streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/controller/PassportController.java:
##########
@@ -102,6 +109,46 @@ public RestResponse signin(
return new RestResponse().data(userInfo);
}
+ @PostMapping("signinbycasdoor")
+ public RestResponse signinByCasdoor(@NotBlank(message = "{required}")
String code,
+ @NotBlank(message = "{required}")
String state) throws Exception {
+ String token = "";
+ String username = "";
+ String password = "";
+ token = casdoorAuthService.getOAuthToken(code, state);
+ CasdoorUser casdoorUser = casdoorAuthService.parseJwtToken(token);
+ User user = userService.findByName(casdoorUser.getName());
+ if (user == null) {
+ User user2 = new User();
+ user2.setUsername(casdoorUser.getName());
+ user2.setNickName(casdoorUser.getDisplayName());
+ user2.setPassword(casdoorUser.getPassword());
+ user2.setUserType(UserType.ADMIN);
Review Comment:
hi jakiuncle:
thanks for your contribution, looks very good, But some details need to be
discussed, welcome to subscribe to our email:
[[email protected]](mailto:[email protected]), discuss
together.
--
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]