• spring bootadmin 监控中心 配置登录密码


    1. pom 加入 security

    		<!-- 加入密码认证 -->
    		<dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-security</artifactId>
            </dependency>

    2.加入配置类 SecuritySecureConfig

    package org.fh.config;
    
    import org.springframework.context.annotation.Configuration;
    import org.springframework.security.config.annotation.web.builders.HttpSecurity;
    import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
    import org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler;
    
    import de.codecentric.boot.admin.server.config.AdminServerProperties;
    
    /**
     * 说明:SecuritySecure配置
     * 作者:FH Admin
     * from:fhadmin.cn
     */
    @Configuration
    public class SecuritySecureConfig extends WebSecurityConfigurerAdapter {
    
    	private final String adminContextPath;
    
    	public SecuritySecureConfig(AdminServerProperties adminServerProperties) {
    		this.adminContextPath = adminServerProperties.getContextPath();
    	}
    
    	@Override
    	protected void configure(HttpSecurity http) throws Exception {
    
    		SavedRequestAwareAuthenticationSuccessHandler successHandler = new SavedRequestAwareAuthenticationSuccessHandler();
    		successHandler.setTargetUrlParameter("redirectTo");
    
    		http.headers().frameOptions().disable();
    		
    		http.authorizeRequests().antMatchers(adminContextPath + "/assets/**",adminContextPath + "/actuator/**").permitAll()
    				.antMatchers(adminContextPath + "/login").permitAll().anyRequest().authenticated().and().formLogin()
    				.loginPage(adminContextPath + "/login").successHandler(successHandler).and().logout()
    				.logoutUrl(adminContextPath + "/logout").and().httpBasic().and().csrf().disable();
    
    	}
    	
    }
    

    3.  配置application.properties

    #开启安全认证 用户名和密码
    spring.security.user.name=fhadmin
    spring.security.user.password=root
    spring.security.basic.enabled=true

    当前最新框架组合方案-------------------------------------------------------------------------------------

    (后台框架 :springcloud 2021.0.1 + springcloud Alibaba 2021.0.1.0  + springboot 2.6.5 + flowable6.7.2 流程引擎 )

    springcloud服务  (fhadmin.cn)
    1 .nacos 阿里注册中心:官方eureka停止更新,目前比较好的取代者就是nacos
    2. zipkin 跟踪服务:分布式跟踪日志,基于内存存储记录
    3 .gateway 网关路由服务:分发请求,统一管理过滤,结合   LoadBalancer负载均衡、 feign服务调用
    4. springboot-admin  监控中心服务:统一界面管理,查看各个服务运行状态   actuator健康检查
    5. sentinel 高可用流量管理框架: 以流量为切入点,限流、流量整形、熔断降级、系统负载保护、热点防护
  • 相关阅读:
    【C++和C#的区别杂谈】后自增运算符的结算时机
    个人作业——软件工程实践总结&个人技术博客
    Unity常见的三种数据本地持久化方案
    C++的逗号运算符
    米哈游--2020春招实习
    厦门飞鱼科技--2020春招实习
    tap4fun(成都尼必鲁)--2020春招实习
    腾讯IEG--2020春招实习
    吉比特&雷霆游戏--2020春招实习
    Docker 基础知识
  • 原文地址:https://www.cnblogs.com/m13002622490/p/16115898.html
Copyright © 2020-2023  润新知