Skip to content

Commit

Permalink
Restore custom authorities (roles) mapper
Browse files Browse the repository at this point in the history
  • Loading branch information
nikitades committed Oct 22, 2023
1 parent 4e658a2 commit 5e9a512
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public SecurityFilterChain filterChain(HttpSecurity http, MvcRequestMatcher.Buil
.requestMatchers(mvc.pattern("/actuator/health"))
.permitAll()
.requestMatchers(mvc.pattern("/actuator/prometheus"))
.hasAnyAuthority("metrics-scraper");
.hasAuthority("metrics-scraper");
requests.anyRequest().authenticated();
})
.oauth2ResourceServer(oauth2 -> oauth2.jwt(Customizer.withDefaults()));
Expand All @@ -55,6 +55,7 @@ MvcRequestMatcher.Builder mvc(HandlerMappingIntrospector introspector) {
return new MvcRequestMatcher.Builder(introspector);
}

@Bean
protected JwtAuthenticationConverter authenticationConverter() {
JwtGrantedAuthoritiesConverter authoritiesConverter = new JwtGrantedAuthoritiesConverter();
authoritiesConverter.setAuthorityPrefix("");
Expand Down

0 comments on commit 5e9a512

Please sign in to comment.