I'm using Spring Security in my application to protect most of my endpoints. I'm using Spring Security OAuth2 to protect a certain subset. This subset of OAuth protected endpoints are going to be accessed both by external servers, and by users on the resource server itself.
Is it possible to have both kinds of protection on this endpoint, and use either-or? If a user is accessing the endpoint from an external server they will need an OAuth access token to get in, if the user is logged into the resource server directly they will not have an access token, but I would like to use my other filter chain to do my standard authentication.
I've never seen an HTTP block with two separate filter chains before, but maybe there's some way to do it that I don't know of.