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

Commit 89d83c0

Browse files
committed
Merge branch 'develop'
2 parents a809088 + 934bd08 commit 89d83c0

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<groupId>ee.ria.tara</groupId>
77
<artifactId>tara-server</artifactId>
88
<packaging>war</packaging>
9-
<version>1.4.12</version>
9+
<version>1.4.13</version>
1010

1111
<properties>
1212
<cas.version>5.3.9</cas.version>

src/main/java/ee/ria/sso/config/TaraOidcConfiguration.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ public class TaraOidcConfiguration {
161161
@Qualifier("consentApprovalViewResolver")
162162
private ConsentApprovalViewResolver consentApprovalViewResolver;
163163

164-
@Autowired
164+
@Autowired(required=false)
165165
private EidasConfigurationProvider eidasConfigurationProvider;
166166

167167
@Bean
@@ -278,8 +278,12 @@ private ExpirationPolicy oAuthCodeExpirationPolicy() {
278278
}
279279

280280
private List<String> determineSupportedScopes(List<String> oidcScopes) {
281-
return Stream.of(oidcScopes, eidasConfigurationProvider.getAllowedEidasCountryScopeAttributes())
281+
return Stream.of(oidcScopes, getAllowedEidasCountryScopeAttributes())
282282
.flatMap(Collection::stream)
283283
.collect(Collectors.collectingAndThen(Collectors.toList(), Collections::unmodifiableList));
284284
}
285+
286+
private List<String> getAllowedEidasCountryScopeAttributes() {
287+
return eidasConfigurationProvider == null ? Collections.emptyList() : eidasConfigurationProvider.getAllowedEidasCountryScopeAttributes();
288+
}
285289
}

src/main/java/ee/ria/sso/oidc/OidcAuthorizeRequestValidationServletFilter.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
public class OidcAuthorizeRequestValidationServletFilter implements Filter {
3535

3636
private final OidcAuthorizeRequestValidator oidcAuthorizeRequestValidator;
37+
38+
3739
private final EidasConfigurationProvider eidasConfigurationProvider;
3840

3941
@Override
@@ -90,7 +92,10 @@ private void saveOidcRequestParametersToSession(final HttpServletRequest request
9092
String[] scopeElements = getScopeElements(request);
9193
List<TaraScope> scopes = parseScopes(scopeElements);
9294
session.setAttribute(Constants.TARA_OIDC_SESSION_SCOPES, scopes);
93-
session.setAttribute(Constants.TARA_OIDC_SESSION_SCOPE_EIDAS_COUNTRY, parseScopeEidasCountry(scopeElements).orElse(null));
95+
96+
if (eidasConfigurationProvider != null) {
97+
session.setAttribute(Constants.TARA_OIDC_SESSION_SCOPE_EIDAS_COUNTRY, parseScopeEidasCountry(scopeElements).orElse(null));
98+
}
9499

95100
session.setAttribute(Constants.TARA_OIDC_SESSION_CLIENT_ID,
96101
request.getParameter(OidcAuthorizeRequestParameter.CLIENT_ID.getParameterKey())

0 commit comments

Comments
 (0)