```@Configuration @EnableAuthorizationServer class...
# spring
t
Copy code
@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")
    }
}
i
You might need to configure
ResourceServerConfigurerAdapter
too and allow that path
/oauth/token
with antMatcher
t
I figured it out. So dumb. I was not putting the values as params in postman.
thanks though!!
i
🤗