阅读 423

Spring Security实现分布式认证授权

一、搭建注册中心

1.1 需求分析

回顾技术方案如下:

分布式系统认证技术方案

1、UAA认证服务负责认证授权。
2、所有请求经过网关到达微服务。
3、网关负责鉴权客户端以及请求转发。
4、网关将token解析后传递给微服务,微服务进行授权。

1.2 注册中心

所有的微服务的请求都经过网关,网关从认证中心读取微服务的地址,将请求转发至微服务,注册中心采用Eureka。

1、创建maven工程,工程结构如下:

注册中心工程结构

2、pom依赖如下:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>com.pengjs.book.admin.distributed.security</groupId>
        <artifactId>distributed-security</artifactId>
        <version>0.0.1-SNAPSHOT</version>
    </parent>

    <groupId>com.pengjs.book.admin.distributed.security.discovery</groupId>
    <artifactId>distributed-security-discovery</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>distributed-security-discovery</name>
    <description>distributed-security-discovery</description>

    <properties>
        <java.version>1.8</java.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-autoconfigure</artifactId>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

</project>

2、配置文件application.yml

spring:
  application:
    name: distributed-discovery

server:
  port: 53000
eureka:
  server:
    # 关闭服务自我保护,客户端心跳检测15分钟内错误达到80%的服务会开启保护,导致别人还认为是好用的服务
    enable-self-preservation: false
    # 清理间隔(单位毫秒,默认60*1000),5秒将客户端剔除的服务在服务注册中心列表中剔除
    eviction-interval-timer-in-ms: 10000
    # eureka是CAP理论基于AP策略,为了保证一致性,关闭此切换CP,默认不关闭,false关闭
    shouldUseReadOnlyResponseCache: true
  client:
    register-with-eureka: false # false: 不作为一个客户端注册到注册中心
    fetch-registry: false # 为true时,可以启动,但是异常:cannot execute request on any known server
    instance-info-replication-interval-seconds: 10
    service-url:
      defaultZone: http://localhost:${server.port}/eureka/
  instance:
    hostname: ${spring.cloud.client.ip-address}
    prefer-ip-address: true
    instance-id: ${spring.application.name}:${spring.cloud.client.ip-address}:${spring.application.instance-id:${server.port}}

3、注册中心启动类

@SpringBootApplication
@EnableEurekaServer
public class DistributedSecurityDiscoveryApplication {

    public static void main(String[] args) {
        SpringApplication.run(DistributedSecurityDiscoveryApplication.class, args);
    }

}

二、搭建网关工程

2.1 角色分析

网关整合OAuth2.0有两种思路,一种是认证服务器生成jwt令牌,所有请求统一在网关层验证,判断权限等操作;另外一种是由资源服务器处理,网关只做请求转发。

我们选用第一种,把API网关作为OAuth2.0的资源服务器角色,实现接入客户端权限拦截、令牌解析并转发当前登录用户信息(jsonToken)给微服务,这样下游微服务就不需要关心令牌格式解析以及OAuth2.0相关机制了。

API网关在认证授权体系里主要负责两件事:
(1)作为OAuth2.0的资源服务器角色,实现接入方权限拦截。
(2)令牌解析并转发当前登录用户信息(明文token)给微服务。

微服务拿到明文token(明文token中包含登录用户的身份和权限信息)后也需要做两件事:
(1)用户授权拦截(看当前用户是否有权限访问资源)。
(2)将用户信息存储进当前线程上下文(有利于后续业务逻辑随时获取当前用户信息)。

2.2 创建工程

网关工程结构如下:

网关工程结构

1、pom依赖

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>com.pengjs.book.admin.distributed.security</groupId>
        <artifactId>distributed-security</artifactId>
        <version>0.0.1-SNAPSHOT</version>
    </parent>
    <groupId>com.pengjs.book.admin.distributed.security.gateway</groupId>
    <artifactId>distributed-security-gateway</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>distributed-security-gateway</name>
    <description>distributed-security-gateway</description>

    <properties>
        <java.version>1.8</java.version>
    </properties>

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

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-ribbon</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-openfeign</artifactId>
        </dependency>
        <dependency>
            <groupId>com.netflix.hystrix</groupId>
            <artifactId>hystrix-javanica</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.retry</groupId>
            <artifactId>spring-retry</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-zuul</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-security</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-oauth2</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-jwt</artifactId>
        </dependency>
        <dependency>
            <groupId>javax.interceptor</groupId>
            <artifactId>javax.interceptor-api</artifactId>
        </dependency>
        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>fastjson</artifactId>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

</project>

2、配置文件application.yml

spring:
  application:
    name: gateway-server
  main:
    allow-bean-definition-overriding: true

server:
  port: 53010

logging:
  level:
    root: info
    org:
      springframework: info

zuul:
  retryable: true
  ignored-services: "*"
  add-host-header: true
  sensitive-headers: "*"
  routes:
    uaa-service:
      stripPrefix: false
      path: /uaa/**
    order-service:
      stripPrefix: false
      path: /order/**

eureka:
  client:
    service-url:
      defaultZone: http://localhost:53000/eureka/
  instance:
    preferIpAddress: true
    instance-id: ${spring.application.name}:${spring.cloud.client.ip-address}:${spring.application.instance-id:${server.port}}

management:
  endpoints:
    web:
      exposure:
        include: refresh,health,info,env
feign:
  hystrix:
    enabled: false
  compression:
    request:
      enabled: true
      mime-types[0]: text/xml
      mime-types[1]: application/xml
      mime-types[2]: application/json
      min-request-size: 2048
    response:
      enabled: true

统一认证服务(UAA)与统一订单服务都是网关下微服务,需要在网关上新增路由配置:

zuul:
  retryable: true
  ignored-services: "*"
  add-host-header: true
  sensitive-headers: "*"
  routes:
    uaa-service:
      stripPrefix: false
      path: /uaa/**
    order-service:
      stripPrefix: false
      path: /order/**

上面配置了网关接收的请求url若符合/order/**表达式,则将被转发到order-service(统一订单服务)中。

3、启动类

@SpringBootApplication
@EnableZuulProxy
@EnableDiscoveryClient
public class DistributedSecurityGatewayApplication {

    public static void main(String[] args) {
        SpringApplication.run(DistributedSecurityGatewayApplication.class, args);
    }

}

三、网关资源服务配置

3.1 配置资源服务

ResourceServerConfig中定义资源服务资源,主要配置的内容就是定义一些匹配规则,描述某个接入客户端需要什么样的权限才能访问某个微服务:

@Configuration
public class ResourceServerConfig {

    /**
     * 资源列表,与服务端的resourceIds一致
     */
    private static final String RESOURCE_ID = "res1";

    /**
     * 从TokenConfig中注入tokenStore
     */
    @Autowired
    private TokenStore tokenStore;

    /**
     * uaa资源服务配置
     */
    @Configuration
    @EnableResourceServer
    public class UaaServerConfig extends ResourceServerConfigurerAdapter {

        @Override
        public void configure(ResourceServerSecurityConfigurer resources) throws Exception {
            resources.tokenStore(tokenStore).resourceId(RESOURCE_ID)
                    .stateless(true);
        }

        @Override
        public void configure(HttpSecurity http) throws Exception {
            // uaa认证全部放行
            http.authorizeRequests()
                    .antMatchers("/uaa/**").permitAll();
        }
    }

    /**
     * order资源服务配置
     */
    @Configuration
    @EnableResourceServer
    public class OrderServerConfig extends ResourceServerConfigurerAdapter {

        @Override
        public void configure(ResourceServerSecurityConfigurer resources) throws Exception {
            resources.tokenStore(tokenStore).resourceId(RESOURCE_ID)
                    .stateless(true);
        }

        @Override
        public void configure(HttpSecurity http) throws Exception {
            // order需要有ROLE_API的scope
            http.authorizeRequests()
                    .antMatchers("/order/**")
                    .access("#oauth2.hasScope('ROLE_API')");
        }

    }

    // 配置其他资源服务。。。

}

3.2 安全配置

/**
 * 安全访问控制
 */
@Configuration
@EnableGlobalMethodSecurity(securedEnabled = true, prePostEnabled = true)
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {

    /**
     * 安全拦截机制(最重要)
     * @param http
     * @throws Exception
     */
    @Override
    protected void configure(HttpSecurity http) throws Exception {
        // 网关:所有的请求都放行,只在resource config中拦截
        http.authorizeRequests()
                .antMatchers("/**").permitAll()
                .and().csrf().disable();
    }
}

四、转发明文token给微服务

通过Zuul过滤器的方式实现,目的是让上下游微服务能够很方便的获取到当前的登录用户信息(明文token)

(1)实现Zuul前置过滤器,完成当前登录用户信息提取,并放入转发到微服务的request中

/**
 * token传递拦截
 */
public class AuthFilter extends ZuulFilter {

    @Override
    public String filterType() {
        // 请求之前进行拦截
        return "pre";
    }

    @Override
    public int filterOrder() {
        // 最优先,数值越小越优先
        return 0;
    }

    @Override
    public boolean shouldFilter() {
        return true;
    }

    @Override
    public Object run() throws ZuulException {
        // 4. 转发给具体的微服务
        RequestContext context = RequestContext.getCurrentContext();
        // 1. 从安全的上下文中获取当前用户对象
        Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
        // 无token直接访问网关内资源的情况,目前只有uaa服务直接暴露
        if (!(authentication instanceof OAuth2Authentication)) {
            // 不解析
            return null;
        }
        OAuth2Authentication oAuth2Authentication = (OAuth2Authentication) authentication;
        Authentication userAuthentication = oAuth2Authentication.getUserAuthentication();
        // 2. 获取当前用户身份信息
        String principals = userAuthentication.getName();

        // 3. 获取当前用户权限信息
        List<String> authorities = new ArrayList<>();
        userAuthentication.getAuthorities().forEach(s -> authorities.add(((GrantedAuthority) s).getAuthority()));
        OAuth2Request oAuth2Request = oAuth2Authentication.getOAuth2Request();
        Map<String, String> requestParameters = oAuth2Request.getRequestParameters();

        // 4. 把身份信息和权限信息中,加入到http的header中
        // 保留原本的基本信息
        Map<String, Object> jsonToken = new HashMap<>(requestParameters);
        if (userAuthentication != null) {
            jsonToken.put("principal", principals);
            jsonToken.put("authorities", authorities);
        }
        // 5. 组装明文token,转发给微服务。放入header,名称json-token
        context.addZuulRequestHeader("json-token", EncryptUtil.encodeUTF8StringBase64(JSON.toJSONString(jsonToken)));
        return null;
    }
}

(2)将Filter纳入到Spring容器
配置AuthFilter

@Configuration
public class ZuulConfig {

    @Bean
    public AuthFilter preFilter() {
        return new AuthFilter();
    }

    @Bean
    public FilterRegistrationBean corsFilter() {
        final UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
        final CorsConfiguration config = new CorsConfiguration();
        config.setAllowCredentials(true);
        config.addAllowedOrigin("*");
        config.addAllowedHeader("*");
        config.addAllowedMethod("*");
        config.setMaxAge(18000L);
        source.registerCorsConfiguration("/**", config);
        CorsFilter corsFilter = new CorsFilter(source);
        FilterRegistrationBean bean = new FilterRegistrationBean(corsFilter);
        bean.setOrder(Ordered.HIGHEST_PRECEDENCE);
        return bean;
    }

}

五、微服务解析令牌并鉴权

当微服务收到明文token后,该怎么鉴权拦截呢?自己实现一个Filter?自己解析明文token,自己定义一套资源访问策略?
能不能适配Spring Security呢,是不是突然想起了前面我们实现的Spring Security基于token认证的例子。咱们还是拿统一订单服务作为网关下游微服务,对它进行改造,增加微服务用户鉴权拦截功能。

(1)增加测试资源
OrderController增加以下endpoint:

@RestController
public class OrderController {

    /**
     * 流程:当携带token访问这个资源的时候,会通过远程的service去请求地址
     * http://localhost:53020/uaa/oauth/check_token校验token是否合法
     * @return
     */
    @GetMapping(value = "/r1")
    // 拥有p1权限方可访问此URL
    @PreAuthorize("hasAnyAuthority('p1')")
    public String r1() {
        // 通过spring security api获取当前登录用户
        UserDto userDto = (UserDto) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
        // String username = (String) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
        // return username + "访问资源1";
        // return userDto.getUsername() + "访问资源1";
        return JSON.toJSONString(userDto) + "访问资源1";
    }

    @GetMapping(value = "/r2")
    // 拥有p2权限方可访问此URL
    @PreAuthorize("hasAnyAuthority('p2')")
    public String r2() {
        UserDto userDto = (UserDto) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
        // return userDto.getUsername() + "访问资源2";
        return JSON.toJSONString(userDto) + "访问资源2";
    }

}

(2)Spring Security配置
开启方法保护,并增加Spring配置策略,除了/login方法不受保护(统一认证要调用),其他的资源全部需要认证才能访问。

@Configuration
@EnableResourceServer
// 或者是单独配置WebSecurityConfig也可以
@EnableGlobalMethodSecurity(prePostEnabled = true)
public class ResourceServerConfig extends ResourceServerConfigurerAdapter {

    /**
     * 资源列表,与服务端的resourceIds一致
     */
    private static final String RESOURCE_ID = "res1";

    /**
     * 从TokenConfig中注入tokenStore
     */
    @Autowired
    private TokenStore tokenStore;

    @Override
    public void configure(ResourceServerSecurityConfigurer resources) throws Exception {
        // 资源id
        resources.resourceId(RESOURCE_ID)
                // 验证令牌的服务
                // .tokenServices(tokenService())
                // 不再使用验证令牌服务,让其自己验证
                .tokenStore(tokenStore)
                .stateless(true);
    }

    /**
     * 资源访问策略
     * @param http
     * @throws Exception
     */
    @Override
    public void configure(HttpSecurity http) throws Exception {
        http.authorizeRequests()
                .antMatchers("/**")
                // .access("#oauth2.hasScope('all')") // 所有的请求都必须有scope=all,跟服务端一致
                .access("#oauth2.hasScope('ROLE_ADMIN')") // 所有的请求都必须有scope=ROLE_ADMIN,跟服务端一致
                .and().csrf().disable() // 关闭CSRF
                // 基于token的方式,session就不用再记录了
                .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS);
    }

}

综合以上配置,共定义了三个资源,拥有p1权限才可以访问r1资源,拥有p2权限才可以访问r2资源。

(3)定义Filter拦截token,并形成Spring Security的Authentication对象

@Component
public class TokenAuthenticationFilter extends OncePerRequestFilter {
    @Override
    protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException {
        String token = request.getHeader("json-token");
        if (null != token) {
            // 1. 解析token
            // 解码
            String json = EncryptUtil.decodeUTF8StringBase64(token);
            // 将token转成json对象
            JSONObject userJson = JSON.parseObject(json);
            // UserDto user = new UserDto();
            // // 用户身份信息
            // user.setUsername(userJson.getString("principal"));
            // uaa那边存的是整个用户的信息,这里就可以直接转为UserDto
            UserDto user = JSON.parseObject(userJson.getString("principal"), UserDto.class);
            // 用户权限
            JSONArray authoritiesArray = userJson.getJSONArray("authorities");
            String[] authorities = authoritiesArray.toArray(new String[authoritiesArray.size()]);

            // 2. 新建并填充authentication(身份信息和权限)
            UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(user,
                    null, AuthorityUtils.createAuthorityList(authorities));
            // 设置details
            authentication.setDetails(new WebAuthenticationDetailsSource().buildDetails(request));

            // 3. 将authentication保存到安全上下文中
            SecurityContextHolder.getContext().setAuthentication(authentication);
        }
        // 过滤器继续往前走
        filterChain.doFilter(request, response);
    }
}

经过上边的过滤器,资源服务中就可以方便的获取到用户的身份信息:

UserDto userDto = (UserDto) SecurityContextHolder.getContext().getAuthentication().getPrincipal();

六、集成测试

本案例测试过程描述:
1、采用OAuth2.0的密码模式从UAA中获取token
2、使用该token通过网关访问订单服务的测试资源

(1)通过网关访问UAA的授权获取令牌,获取token,注意网关端口是53010
http://127.0.0.1:53010/uaa/oauth/token

通过网关访问UAA的授权获取令牌

(2)通过网关UAA校验token
http://127.0.0.1:53010/uaa/oauth/check_token

通过网关UAA校验token

(3)带上token访问资源
http://localhost:53010/order/r1

带上token访问资源

七、扩展用户信息

7.1 需求分析

目前jwt令牌存储了用户身份信息、权限信息,网关将token明文转发给微服务使用,目前用户身份信息锦包含了用户的账户,微服务还需要用户的ID、手机号等重要信息。

在认证阶段DaoAuthenticationProvider会调用UserDetailsService查询用户信息,这里是可以获取到齐全的用户信息的。由于JWT令牌中用户身份信息来源于UserDetailsUserDetails中仅定义了username为用户的身份信息,这里有两个思路,第一是可以扩展UserDetails,使之包含更多的自定义属性,第二也可以扩展username的内容,比如存入json数据内容作为username的内容。相比较而言,方案二比较简单还不用破坏UserDetails的结构,我们采用方案二。

7.2 修改UserDetailsService

从数据库查询到user,将整体的user转成json存入到UserDetails对象中。

    @Override
    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
        // 将来连接数据库根据账号查询用户信息
        // 登录账号
        System.out.println("username=" + username);
        UserDto userByUsername = userDao.getUserByUsername(username);
        if (null == userByUsername) {
            // 如果用户查询不到,返回null,返回给provider,由provider来抛异常
            return null;
        }
        // 根据用户的ID查询用户的权限
        List<String> permissions = userDao.findPermissionByUserId(userByUsername.getId());
        String[] permissionArray = new String[permissions.size()];
        permissions.toArray(permissionArray);
        // 将userByUsername转换为json,整体存入到userDetails
        String principal = JSON.toJSONString(userByUsername);
        UserDetails userDetails = User.withUsername(principal).password(userByUsername.getPassword())
                .authorities(permissionArray).build();
        return userDetails;
    }

7.3 修改资源服务器过滤器

资源服务中的过滤器负责从Header中解析json-token,从中即可拿到网关放入的用户身份信息,代码如下:

@Component
public class TokenAuthenticationFilter extends OncePerRequestFilter {
    @Override
    protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException {
        String token = request.getHeader("json-token");
        if (null != token) {
            // 1. 解析token
            // 解码
            String json = EncryptUtil.decodeUTF8StringBase64(token);
            // 将token转成json对象
            JSONObject userJson = JSON.parseObject(json);
            // UserDto user = new UserDto();
            // // 用户身份信息
            // user.setUsername(userJson.getString("principal"));
            // uaa那边存的是整个用户的信息,这里就可以直接转为UserDto
            UserDto user = JSON.parseObject(userJson.getString("principal"), UserDto.class);
            // 用户权限
            JSONArray authoritiesArray = userJson.getJSONArray("authorities");
            String[] authorities = authoritiesArray.toArray(new String[authoritiesArray.size()]);

            // 2. 新建并填充authentication(身份信息和权限)
            UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(user,
                    null, AuthorityUtils.createAuthorityList(authorities));
            // 设置details
            authentication.setDetails(new WebAuthenticationDetailsSource().buildDetails(request));

            // 3. 将authentication保存到安全上下文中
            SecurityContextHolder.getContext().setAuthentication(authentication);
        }
        // 过滤器继续往前走
        filterChain.doFilter(request, response);
    }
}

八、总结

重点回顾:

什么是认证、授权、会话。
Java Servlet为支持http会话做了哪些是儿。
基于Session认证机制的运作流程。
基于token认证机制的运作流程。
理解Spring Security的工作原理,Spring Security结构总览,认证流程和授权,中间涉及到哪些组件,这些组件分别处理什么,如何自定义这些组件满足个性需求。
OAuth2.0认证的四种模式?他们的大体流程是什么?
Spring Cloud Security OAuth2.0包括哪些组件?自责?
分布式系统认证需要解决的问题?

作者:Doooook

原文链接:https://www.jianshu.com/p/9ad97fba2216

文章分类
后端
版权声明:本站是系统测试站点,无实际运营。本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 XXXXXXo@163.com 举报,一经查实,本站将立刻删除。
相关推荐