zoukankan      html  css  js  c++  java
  • 开启spring boot actuator 安全认证

    通过本文配置,会对actuator 除了health外的所有端点,开启用户名密码验证,对于自己开发的接口不会要求用户名密码验证。

    版本:

        <parent>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-parent</artifactId>
            <version>1.5.4.RELEASE</version>
            <relativePath/> <!-- lookup parent from repository -->
        </parent>
    
    <dependencyManagement>
            <dependencies>
                <dependency>
                    <groupId>org.springframework.cloud</groupId>
                    <artifactId>spring-cloud-dependencies</artifactId>
                    <version>Dalston.SR1</version>
                    <type>pom</type>
                    <scope>import</scope>
                </dependency>
            </dependencies>
        </dependencyManagement>

    maven依赖:

            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-actuator</artifactId>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-security</artifactId>
            </dependency>        

    配置:

    management:
      security:
        enabled: true
    security:
      user:
        name: xxx
        password: xxx
      basic:
        enabled: false
  • 相关阅读:
    II、Python HelloWorld
    初次比较正式的IT职场面试后几点对自己web开发的思考
    网页调用迅雷下载文件
    php PAC 安装
    php 大文件上传的实现
    正则表达式
    怎么看待php 面向对象思想
    IT职场初体验一
    php 发送邮件
    web的seo
  • 原文地址:https://www.cnblogs.com/flying607/p/8796751.html
Copyright © 2011-2022 走看看