@Configuration
@EnableAuthorizationServer
public class AuthorizationServerConfig extends AuthorizationServerConfigurerAdapter{
// @Autowired
private PasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
@Override
public void configure(ClientDetailsServiceConfigurer clients) throws Exception {
clients.inMemory()
.withClient("client1")
.secret(passwordEncoder.encode("123"))
.redirectUris("http://example.com")
.scopes("all")
.authorizedGrantTypes("authorization_code", "refresh_token", "password");
// .autoApprove(false);
}
}
这是配置了密码模式吗,为什么会这样啊
Spring Security技术栈,REST风格开发常见接口,独立开发认证授权模块保证REST服务安全
了解课程