Apollo支持完善的管理界面,支持多环境,配置变更实时生效,权限和配置审计等多种生产级功能 错误信息 App ID is set to appblog-gateway by app.id property from System Property Environment is set to nu
Disconf web的安装配置 Disconf web是Disconf的管理界面及服务器,通过它来配置管理我们的配置文件。 客户端配置 (1)创建普通的SpringBoot项目config-disconf,在pom.xml文件中增加如下依赖 <dependency> <gr
Spring Boot 使用事务非常简单,首先使用注解@EnableTransactionManagement开启事务支持后,然后在访问数据库的Service方法上添加注解@Transactional便可。 关于事务管理器,不管是JPA还是JDBC等都实现自接口PlatformTransaction
Spring Boot实现事务特别特别简单,没有多余操作,一个注解@Transactional搞定 依赖的Jar包pom.xml Spring Boot中实现事务没有额外的Jar包,还是基本的数据库访问包,比如Mybatis <dependency> <groupId&g
通常来说,Controller都会返回一个视图名称,Spring Boot会默认在main/resource/templates目录下找,因为该目录是安全的,意味着该目录下的内容是不允许外界直接访问的。有些情况下,Controller会返回客户端一个HTTP Redirect重定向请求,希望客户端按
现象描述 Spring Boot工程中使用@Async时,碰到循环依赖(circular reference)问题: Caused by: org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creati
jwt token错误 Linux服务器上最近使用jwt token的时候遇到了一个奇怪的问题: InvalidClaimException: The Token can't be used before 某个时间 本地调试完全没问题,测试环境只使用一台也没问题,但是一旦启用多台服务器就
方案引入 跟踪Spring Security的登录逻辑发现,帐号密码的验证是在tokenGranter中完成的。帐号密码方式对应的是 org.springframework.security.oauth2.provider.password.ResourceOwnerPasswordTokenGra
在org.springframework.security.authentication.event包下定义了发生认证时的所有事件类型,其中AbstractAuthenticationEvent是所有事件的父类,其它事件都继承于AbstractAuthenticationEvent,其子类有 Ab
通常用户登录成功或者失败之后要做一些处理,比如日志记录、数据初始化等等;Spring中提供了事件及监听器,而Spring Security很好的运用了这一特点,框架中用了很多的事件来处理,要想很好的控制这些,先熟悉下源码,要知其所以然。 ProviderManager类分析 已经对该类进行过分析,
多AuthenticationProvider实现ProviderManager会按照加入认证请求链中的顺序来验证,前文的源码分析及实现原理已经说的很清楚了,本文直接看代码实现; AuthenticationProvider认证类UserSmsAuthenticationProvider实现 /*
AuthenticationManager类源码解析 public interface AuthenticationManager { Authentication authenticate(Authentication authentication) throws
Spring事件简介 Spring中的事件分为三部分:事件、监听器、事件源,其中事件是核心,涉及到ApplicationEventPublisher接口、ApplicationEvent类、ApplicationListener接口 定义用户登录失败事件 /** * @Description:
使用Security OAuth2的时候需要返回给前端用户的角色或者权限,框架提供了GrantedAuthority接口,有一个默认的实现SimpleGrantedAuthority,但是它只能返回简单 的字符串,如果我们想灵活的使用很难控制;所以我这边通过实现GrantedAuthority接口,
官方文档说明 地址:https://projects.spring.io/spring-security-oauth/docs/oauth2.html scope: The scope to which the client is limited. If scope is undefined or