Robin_0028
2018-04-24 11:18
演示代码的github地址有吗
//1.创建securityManager环境 DefaultSecurityManager defaultSecurityManager = new DefaultSecurityManager(); defaultSecurityManager.setRealm(accountRealm); //2.主体提交认证 SecurityUtils.setSecurityManager(defaultSecurityManager); Subject subject = SecurityUtils.getSubject(); UsernamePasswordToken token = new UsernamePasswordToken("Mark","123456"); subject.login(token); subject.checkRole("admin"); System.out.print("isAuthenticated:"+subject.isAuthenticated()); subject.logout();
没有的
Shiro安全框架入门
48040 学习 · 332 问题
相似问题