Tag: 安全

Spring Security,Method Security注解(@Secured)不工作(java config)

我正在尝试使用@Secured(“ADMIN”)(没有任何XML,只有java配置,Spring Boot)来设置方法安全注释。 但通过角色访问不起作用。 安全配置: @Configuration @EnableWebSecurity public class AppSecurityConfiguration extends WebSecurityConfigurerAdapter{ ….. @Override protected void configure(HttpSecurity http) throws Exception { http .authorizeRequests() .antMatchers("/api/**").fullyAuthenticated().and() .addFilterBefore(tokenAuthenticationFilter(), UsernamePasswordAuthenticationFilter.class); } ….. } 我想限制访问控制器的方法: @RestController @RequestMapping("/api/groups") public class GroupController { @Autowired private GroupService groupService; @Secured("ADMIN") @RequestMapping public List<Group> list() { return groupService.findAll(); } } 通过url限制访问正在工作,与: .antMatchers("/api/**").hasAuthority("ADMIN") 也许我忘了指定,我想限制的角色? UPD:按照规则,在控制层或服务层中的哪个层必须是@PreAuthorize("hasRole('ADMIN')") ?

Kotlin比Java更难于逆向工程

我正在决定哪一个用于Android Studio项目,我愿意使用Kotlin。 如果在反向工程方面比java更难。

Kotlin是否提供额外的安全性?

当我们在Java中开发Android应用程序时,我们可以选择混淆代码并构建APK。 Kotlin有没有什么先进的功能可以做到这一点?