1
나는 인증 서버에 JDBC 토큰 저장소를 사용했다. 그러나 나는 소비자 토큰 서비스에 대해 모른다. 아무도 나를 설명 할 수 있습니까? 소비자 토큰 서비스를 사용하여 액세스 토큰을 이동하는 방법은 무엇입니까?
인증 Cofig봄 부팅 oauth2에서 소비자 토큰 서비스를 사용하는 것은 무엇입니까?
@Configuration
@EnableAuthorizationServer 공용 클래스 OAuthServerConfig는 AuthorizationServerConfigurerAdapter {
@Autowired
private UserDetailsServiceImpl userDetailsService;
@Autowired
AuthenticationManager authenticationManager;
@Autowired
Environment environment;
@Autowired
@Qualifier("dataSourceApi")
DataSource dataSource;
@Primary
@Bean
public ConsumerTokenServices defaultTokenServices() {
DefaultTokenServices defaultTokenServices = new DefaultTokenServices();
defaultTokenServices.setTokenStore(tokenStore());
return defaultTokenServices;
}
@Bean
public JdbcTokenStore tokenStore() {
return new JdbcTokenStore(dataSource);
}
@Bean
public JdbcClientDetailsService jdbcClientDetailsService() {
return new JdbcClientDetailsService(dataSource);
}
@Override
public void configure(AuthorizationServerEndpointsConfigurer endpoints) throws Exception {
endpoints.tokenStore(tokenStore()).authenticationManager(authenticationManager);
}
@Override
public void configure(ClientDetailsServiceConfigurer clients) throws Exception {
clients.jdbc(dataSource);
}
@Override
public void configure(AuthorizationServerSecurityConfigurer security) throws Exception {
}
}