Skip to content

Commit 1f1a2de

Browse files
AB2D-6303 Get CapabilityStatement without bearer token (#1394)
* Add AB2D-6303 logging statements * Merged and squashed --------- Co-authored-by: Jeremy Jones <[email protected]>
1 parent 0916b4f commit 1f1a2de

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

api/src/main/java/gov/cms/ab2d/api/security/JwtTokenAuthenticationFilter.java

+5
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,11 @@ private boolean shouldBePublic(String requestUri) {
223223
return true;
224224
}
225225

226+
if (requestUri.endsWith("/metadata")) {
227+
log.debug("metadata requested");
228+
return true;
229+
}
230+
226231
return false;
227232
}
228233

api/src/main/java/gov/cms/ab2d/api/security/SecurityConfig.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
4848
private final String[] authExceptions = new String[]{"/swagger-ui/**", "/configuration/**",
4949
"/swagger-resources/**", "/v3/api-docs/**", "/webjars/**",
5050
AKAMAI_TEST_OBJECT, "/favicon.ico", "/error", HEALTH_ENDPOINT, STATUS_ENDPOINT,
51-
"/metadata"};
51+
"/**/metadata"};
5252

5353
@Override
5454
protected void configure(HttpSecurity security) throws Exception {
@@ -62,9 +62,9 @@ protected void configure(HttpSecurity security) throws Exception {
6262
// Add a filter to validate the tokens with every request.
6363
.addFilterAfter(jwtTokenAuthenticationFilter, UsernamePasswordAuthenticationFilter.class)
6464
.authorizeHttpRequests()
65+
.antMatchers(authExceptions).permitAll()
6566
.antMatchers(API_PREFIX_V1 + ADMIN_PREFIX + "/**").hasAuthority(ADMIN_ROLE)
6667
.antMatchers(API_PREFIX_V1 + FHIR_PREFIX + "/**").hasAnyAuthority(SPONSOR_ROLE)
67-
.antMatchers(authExceptions).permitAll()
6868
.anyRequest().authenticated();
6969

7070
// Override default behavior to add more informative logs

0 commit comments

Comments
 (0)