MonsterChenzhuo opened a new pull request, #1836:
URL: https://github.com/apache/incubator-streampark/pull/1836
## What problem does this PR solve?
Issue Number: close #1735
Problem Summary:
## What is changed and how it works?
History Logic: in application.yaml
``` yaml
#select the login mode: 1. PASSWORD 2.LDAP
security:
authentication:
type: PASSWORD
```
to choose whether to load the ldap or local user login implementation class.
Now the logic: the two implementation classes correspond to two different
interfaces, and the front-end option box is checked to determine whether to use
ldap login or local user login
```java
@PostMapping("signin")
public RestResponse signin(
@NotBlank(message = "{required}") String username,
@NotBlank(message = "{required}") String password) throws Exception {
if (StringUtils.isEmpty(username)) {
return RestResponse.success().put("code", 0);
}
User user = authenticator.authenticate(username, password);
Map<String, Object> userInfo = login(username, password, user);
return new RestResponse().data(userInfo);
}
@PostMapping("ldapSignin")
public RestResponse ldapSignin(
@NotBlank(message = "{required}") String username,
@NotBlank(message = "{required}") String password) throws Exception {
if (StringUtils.isEmpty(username)) {
return RestResponse.success().put("code", 0);
}
User user = authenticator.ldapAuthenticate(username, password);
Map<String, Object> userInfo = login(username, password, user);
return new RestResponse().data(userInfo);
}
```
## Contribution Checklist
- Make sure that the pull request corresponds to a [GITHUB
issue](https://github.com/apache/streampark/issues).
- Name the pull request in the form "[Feature] [component] Title of the
pull request", where *Feature* can be replaced by `Hotfix`, `Bug`, etc.
- Minor fixes should be named following this pattern: `[hotfix] [docs] Fix
typo in README.md doc`.
## Purpose of this pull request
Support the team management, it includes team management, team member
management, all old projects and apps will be migrated to the default team.
--
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]