美文网首页
2019-01-07

2019-01-07

作者: 李彬燊666 | 来源:发表于2019-01-08 13:21 被阅读0次

                                                                                     自定义可以认证的用户信息:

//做定义主体的认证

        //默认启动报错:Cannot pass a null GrantedAuthority collection

//以上报错解决:必须每一个用户都有自己默认的权限信息

//权限使用roles(角色)或者authorities(权限)【权限】,

@Override

protected void configure(AuthenticationManagerBuilder auth) throws Exception {

// TODO Auto-generated method stub

//super.configure(auth);

auth.inMemoryAuthentication().withUser("lbs").password("libinshen").roles("admin","学徒","宗师")

.and()

.withUser("wbc").password("666").authorities("admin");

}

相关文章

网友评论

      本文标题:2019-01-07

      本文链接:https://www.haomeiwen.com/subject/pqkmrqtx.html