Authentication 优化
This commit is contained in:
@@ -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());
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -3,25 +3,28 @@
|
||||
application.title=MaxKey
|
||||
application.name=MaxKey
|
||||
application.formatted-version=v2.3.0 GA
|
||||
#server config
|
||||
#spring.profiles.active=dev
|
||||
|
||||
#server port
|
||||
#server.port=80
|
||||
server.port=443
|
||||
|
||||
#ssl
|
||||
server.ssl.key-store=maxkeyserver.keystore
|
||||
server.ssl.key-alias=maxkey
|
||||
server.ssl.enabled=true
|
||||
server.ssl.key-store-password=maxkey
|
||||
server.ssl.key-store-type=JKS
|
||||
|
||||
#web app context path
|
||||
server.servlet.context-path=/maxkey
|
||||
spring.servlet.multipart.enabled=true
|
||||
spring.servlet.multipart.max-file-size=4194304
|
||||
|
||||
#encoding
|
||||
#server.servlet.encoding.charset=UTF-8
|
||||
#server.servlet.encoding.enabled=true
|
||||
#server.servlet.encoding.force=true
|
||||
|
||||
#datasource
|
||||
spring.datasource.username=root
|
||||
spring.datasource.password=maxkey
|
||||
@@ -32,6 +35,7 @@ spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
|
||||
mybatis.type-aliases-package=org.maxkey.domain,org.maxkey.domain.apps,
|
||||
mybatis.mapper-locations=classpath*:/org/maxkey/persistence/mapper/xml/mysql/*.xml
|
||||
mybatis.table-column-escape=true
|
||||
|
||||
#redis
|
||||
spring.redis.host=127.0.0.1
|
||||
spring.redis.port=6379
|
||||
@@ -53,6 +57,7 @@ spring.mail.properties.ssl=true
|
||||
spring.mail.properties.sender=maxkey@163.com
|
||||
spring.mail.properties.mailotp.message.subject=MaxKey One Time PassWord
|
||||
spring.mail.properties.mailotp.message.template={0} You Token is {1} , it validity in {2} minutes.
|
||||
|
||||
#for freemarker
|
||||
spring.freemarker.template-loader-path=classpath:/templates/views
|
||||
spring.freemarker.cache=false
|
||||
@@ -63,10 +68,12 @@ spring.freemarker.expose-request-attributes=false
|
||||
spring.freemarker.expose-session-attributes=false
|
||||
spring.freemarker.request-context-attribute=request
|
||||
spring.freemarker.suffix=.ftl
|
||||
|
||||
#static resources
|
||||
spring.mvc.static-path-pattern=/static/**
|
||||
spring.messages.basename=classpath:messages/message
|
||||
spring.messages.encoding=UTF-8
|
||||
|
||||
#main
|
||||
spring.main.banner-mode=log
|
||||
spring.main.allow-bean-definition-overriding=true
|
||||
|
||||
Reference in New Issue
Block a user