Skip to content
This repository was archived by the owner on Nov 29, 2021. It is now read-only.

Commit c16bd78

Browse files
committed
Made client ID and client secret configurable - moved values to constructor
1 parent 270769e commit c16bd78

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/main/java/engineering/everest/starterkit/security/config/AuthServerConfig.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,8 @@ public class AuthServerConfig extends AuthorizationServerConfigurerAdapter {
2727
private final TokenStore tokenStore;
2828
private final int accessTokenValiditySeconds;
2929
private final int refreshTokenValiditySeconds;
30-
31-
@Value("${application.oauth.client.id}")
32-
private String clientId;
33-
@Value("${application.oauth.client.secret}")
34-
private String clientSecret;
30+
private final String clientId;
31+
private final String clientSecret;
3532

3633
@Autowired
3734
public AuthServerConfig(PasswordEncoder passwordEncoder,
@@ -40,7 +37,9 @@ public AuthServerConfig(PasswordEncoder passwordEncoder,
4037
AuthenticationManager authenticationManager,
4138
@Qualifier("authTokenStore") TokenStore tokenStore,
4239
@Value("${application.jwt.access-token.validity-seconds:3600}") int accessTokenValiditySeconds,
43-
@Value("${application.jwt.refresh-token.validity-seconds:7200}") int refreshTokenValiditySeconds) {
40+
@Value("${application.jwt.refresh-token.validity-seconds:7200}") int refreshTokenValiditySeconds,
41+
@Value("${application.oauth.client.id}") String clientId,
42+
@Value("${application.oauth.client.secret}") String clientSecret) {
4443
super();
4544
this.passwordEncoder = passwordEncoder;
4645
this.jwtAccessTokenConverter = jwtAccessTokenConverter;
@@ -49,6 +48,8 @@ public AuthServerConfig(PasswordEncoder passwordEncoder,
4948
this.tokenStore = tokenStore;
5049
this.accessTokenValiditySeconds = accessTokenValiditySeconds;
5150
this.refreshTokenValiditySeconds = refreshTokenValiditySeconds;
51+
this.clientId = clientId;
52+
this.clientSecret = clientSecret;
5253
}
5354

5455
@Override

0 commit comments

Comments
 (0)