-
Hi,
This is my config: com:
c4-soft:
springaddons:
oidc:
ops:
- iss: https://acme.com/iam/auth/realms/72d55467-32e8-4e63-84f5-fcd2f1391012
username-claim: $.preferred_username
authorities:
- path: $.roles
client:
client-uri: ${server-base-url}
security-matchers:
- /login/**
- /oauth2/**
- /logout
- /ui/**
permit-all:
- /login/**
- /oauth2/**
- /public-ui/**
back-channel-logout:
enabled: true
csrf: cookie_accessible_from_js
resourceserver:
permit-all:
- /public-api/**
- /*.js
- /*.html
- /*.eot
- /*.ttf
- /static/**
- /assets/**
csrf: disable
enabled: true
statless-sessions: true The API request is a simple GET http://localhost:7070/registry-api/v2/cfcb4358-707f-443b-8f0d-a401a2cc4112/twins I can also see in the log that the no route is matching and I would assume according to the docu that resourceserver chain will be used.
Do you have any suggestions or pointers I could follow? I’d greatly appreciate any help. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
Do you have As a side note, on a gateway, you should not authorize requests to downstream resource servers with an |
Beta Was this translation helpful? Give feedback.
-
Still struggling with two things:
@Bean
@Order( Ordered.HIGHEST_PRECEDENCE )
SecurityWebFilterChain apiTokenFilterChain( ServerHttpSecurity http, ApiGatewaySecurityProperties apiGatewaySecurityProperties ) {
return http.csrf( csrfCustomizer -> csrf( csrfCustomizer, "host-test" ) ).build();
} If that is defined, e.g. I`m getting the following response in the UI after clicked login: {"error":{"path":"/oauth2/authorization/macma","message":"No static resource oauth2/authorization/macma."}}
spring:
cloud:
gateway:
server:
webflux:
enabled: true
filter:
secure-headers:
referrer-policy: "no-referrer"
content-security-policy: "..." |
Beta Was this translation helpful? Give feedback.
If both
spring-boot-starter-oauth2-resource-server
andspring-addons-starter-oidc
are on the classpath, then anoauth2ResourceServer
filter chain with lowest precedence and no security-matcher should be exposed. It is used only if no other filter chain with higher precedence intercepts the request. Here, the "client" filter chain won't, but if you defined a filter chain yourself (or activated Spring Boot one), then maybe theoauth2ResourceServer
filter chain by spring-addons is never reached.Please add the code for any Java configuration you have. Is your project source accessible somewhere?