From ec26aefadfd03f523bc48d13c4d372c1fefdc7c6 Mon Sep 17 00:00:00 2001 From: anhefti Date: Mon, 4 Feb 2019 17:14:16 +0100 Subject: [PATCH] spring config again --- .../weblayer/oauth/AuthorizationServerConfig.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/oauth/AuthorizationServerConfig.java b/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/oauth/AuthorizationServerConfig.java index 3e71e37e..b4e93440 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/oauth/AuthorizationServerConfig.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/oauth/AuthorizationServerConfig.java @@ -16,7 +16,6 @@ import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; -import org.springframework.context.annotation.Lazy; import org.springframework.core.annotation.Order; import org.springframework.security.authentication.AuthenticationManager; import org.springframework.security.crypto.password.PasswordEncoder; @@ -76,9 +75,8 @@ public class AuthorizationServerConfig extends AuthorizationServerConfigurerAdap clients.withClientDetails(this.webServiceClientDetails); } - @Lazy @Bean - public TokenStore tokenStore() { + public TokenStore tokenStore(final DataSource dataSource) { System.out.println("************************* this.dataSource:" + this.dataSource); return new JdbcTokenStore(this.dataSource); } @@ -88,7 +86,7 @@ public class AuthorizationServerConfig extends AuthorizationServerConfigurerAdap final JwtAccessTokenConverter jwtAccessTokenConverter = new JwtAccessTokenConverter(); jwtAccessTokenConverter.setAccessTokenConverter(this.accessTokenConverter); endpoints - .tokenStore(tokenStore()) + .tokenStore(tokenStore(this.dataSource)) .authenticationManager(this.authenticationManager) .userDetailsService(this.webServiceUserDetails) .accessTokenConverter(jwtAccessTokenConverter);