-
Notifications
You must be signed in to change notification settings - Fork 245
@EnableOAuth2Resource and securing sub-set of resources #14
Comments
I moved to the M3 release and now am seeing a different behavior. Just including the Should I extend OAuth2SsoConfigurerAdapter or does that not work with OAuth2 resources? |
|
Thanks Dave I figured it was something like that, I will give it a shot. |
Thanks Dave, this worked. I also had to extend WebSecurityConfigurerAdapter to make sure anonymous requests did not require basic authentication. I now feel like I am duplicating the RequestMatchers from my Zuul proxy though. I guess I can share code between the two projects and as long as they are using the same paths than they should work for both the Resource and the proxy. In general though the security configuration seems hard to do and pretty complicated for someone not too familiar with Spring Security like me. |
Thanks for the feedback. So you think |
Yes that would be ideal. I think if the Zuul proxy somehow knew about the security routes from the resource it is proxying from that would be ideal. That way the configuration stays with the resource and if the resource is accessed without using the proxy the security routes are still in place. |
Maybe you could open a new issue? |
Done #15 |
I have a pretty straightforward Spring Boot app with an API resource I would like to protect with OAuth2.
In my POM I have added the
spring-cloud-starter-security
dependency. I have a class annotated with@RestController
and@EnableOAuth2Resource
. In my application.properties I have addedWhen I start the app and hit the API endpoints they do not appear to be protected, I am getting back 200s without supplying an access token in the request.
Am I missing another part of the configuration?
The text was updated successfully, but these errors were encountered: