Closed
Description
According to the docs for 1.3 for health access restrictions, a non-sensitive health endpoint should allow anonymous access. However, this stops working if the @EnableResourceServer
annotation is found. When the OAuth2 resource server is enabled, even non-sensitive endpoints require full authentication.
Metadata
Metadata
Assignees
Labels
Type
Projects
Relationships
Development
No branches or pull requests
Activity
philwebb commentedon Feb 3, 2016
@dsyer does the OAuth auto-config mess with security at all?
dsyer commentedon Feb 3, 2016
If you
@EnableResourceServer
and don't provide an order for the filter I guess it's going to be before the actuator one. We could change the default order?quintonm commentedon Feb 3, 2016
I am not sure if this will be helpful or not, but here are the log statements for initialization and a request to the health endpoint. The only non-default configuration I have that affects the actuators is
management.contextPath=/manage
.quintonm commentedon Feb 3, 2016
Also, I tried to override the default configuration using WebSecurityConfigurerAdapter with @order(ManagementServerProperties.ACCESS_OVERRIDE_ORDER). However, that did not seem to have any effect on the issue. I believe that this is due to ResourceServerConfiguration having an order of 3.
I did manage to work around the problem for the health endpoint by adding the following bean definition.
kristofferpeterhansel commentedon Apr 14, 2016
Isn't this a more general issue with with the Actuator access setup. It has an @order annotation that is '2147483637' (5 less than org.springframework.boot.autoconfigure.security.SecurityProperties.BASIC_AUTH_ORDER).
But as you add your own WebSecurityConfigurerAdapter to the app. It is ordered at 100 by default. And will disable this setup silently.
dsyer commentedon Apr 14, 2016
Understanding the role of
@Order
and the values used in existing autoconfig is important here, but there is no issue per se in having orders defined the way they are. There is an issue with anonymous authentication in spring oauth when you try to skip the resource server paths (see github issue in that project for more detail).53 remaining items