File tree Expand file tree Collapse file tree
src/main/java/eu/openanalytics/containerproxy/auth/impl/oidc Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2121package eu .openanalytics .containerproxy .auth .impl .oidc ;
2222
2323import eu .openanalytics .containerproxy .auth .impl .oidc .redis .RedisOAuth2AuthorizedClientService ;
24+ import eu .openanalytics .containerproxy .util .EnvironmentUtils ;
2425import org .springframework .boot .autoconfigure .condition .ConditionalOnProperty ;
2526import org .springframework .context .annotation .Bean ;
2627import org .springframework .context .annotation .Configuration ;
4243import javax .inject .Inject ;
4344import java .util .Collections ;
4445import java .util .HashSet ;
46+ import java .util .List ;
47+ import java .util .Optional ;
4548import java .util .Set ;
4649
4750@ Configuration
@@ -69,11 +72,8 @@ public ClientRegistrationRepository clientRegistrationRepository() {
6972 scopes .add ("openid" );
7073 scopes .add ("email" );
7174
72- for (int i = 0 ; ; i ++) {
73- String scope = environment .getProperty (String .format ("proxy.openid.scopes[%d]" , i ));
74- if (scope == null ) break ;
75- else scopes .add (scope );
76- }
75+ Optional .ofNullable (EnvironmentUtils .readList (environment , "proxy.openid.scopes" ))
76+ .ifPresent (scopes ::addAll );
7777
7878 ClientRegistration client = ClientRegistration
7979 .withRegistrationId (REG_ID )
You can’t perform that action at this time.
0 commit comments