Authentication 优化

This commit is contained in:
Crystal.Sea
2020-11-08 13:05:30 +08:00
parent c1e4b36cbe
commit 06b27d3564
41 changed files with 425 additions and 163 deletions

View File

@@ -17,6 +17,7 @@
package org.maxkey.web.contorller;
import java.security.Principal;
import java.util.List;
import org.maxkey.constants.ConstantsOperateMessage;
import org.maxkey.constants.ConstantsProtocols;
@@ -67,7 +68,7 @@ public class AppListController {
*/
@RequestMapping(value = { "/appList" })
public ModelAndView appList(
@RequestParam(value = "gridList", required = false) String gridList) {
@RequestParam(value = "gridList", required = false) String gridList,Principal principal) {
ModelAndView modelAndView = new ModelAndView("main/appList");
userInfoService.updateGridList(gridList);
modelAndView.addObject("appList", queryAccessableApps());

View File

@@ -25,13 +25,12 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.maxkey.authn.AbstractAuthenticationProvider;
import org.maxkey.authn.BasicAuthentication;
import org.maxkey.authn.LoginCredential;
import org.maxkey.authn.support.kerberos.KerberosService;
import org.maxkey.authn.support.rememberme.AbstractRemeberMeService;
import org.maxkey.authn.support.socialsignon.service.SocialSignOnProviderService;
import org.maxkey.authn.support.wsfederation.WsFederationConstants;
import org.maxkey.configuration.ApplicationConfig;
import org.maxkey.constants.ConstantsOperateMessage;
import org.maxkey.constants.ConstantsStatus;
import org.maxkey.crypto.password.opt.AbstractOptAuthn;
import org.maxkey.domain.UserInfo;
@@ -185,9 +184,9 @@ public class LoginEndpoint {
public ModelAndView logon(
HttpServletRequest request,
HttpServletResponse response,
@ModelAttribute("authentication") BasicAuthentication authentication) throws ServletException, IOException {
@ModelAttribute("loginCredential") LoginCredential loginCredential) throws ServletException, IOException {
authenticationProvider.authenticate(authentication);
authenticationProvider.authenticate(loginCredential);
if (WebContext.isAuthenticated()) {
return WebContext.redirect("/forwardindex");