tjb
12/02/2018, 7:48 AM@Configuration
@EnableAuthorizationServer
class AuthServerConfig(@Value("\${test.oauth.tokenTimeout:3600}")
var expiration: Int): AuthorizationServerConfigurerAdapter() {
@Autowired lateinit var userDetailsService: UserDetailsService
@Autowired lateinit var authenticationManager: AuthenticationManager
@Bean fun passwordEncoder(): PasswordEncoder {
return BCryptPasswordEncoder()
}
override fun configure(configurer: AuthorizationServerEndpointsConfigurer) {
configurer.authenticationManager(authenticationManager)
configurer.userDetailsService(userDetailsService)
}
override fun configure(clients: ClientDetailsServiceConfigurer) {
clients
.inMemory()
.withClient("test") // TODO: Set to settings in application.yml
.accessTokenValiditySeconds(expiration)
.scopes("read", "write")
.authorizedGrantTypes("password", "refresh_token")
}
}
ienoobong
12/03/2018, 9:44 AMResourceServerConfigurerAdapter
too and allow that path /oauth/token
with antMatcherienoobong
12/03/2018, 9:44 AMtjb
12/03/2018, 5:11 PMtjb
12/03/2018, 5:11 PMienoobong
12/03/2018, 5:30 PM