Skip to content
This repository was archived by the owner on May 31, 2022. It is now read-only.
This repository was archived by the owner on May 31, 2022. It is now read-only.

resource server security custom request matching ignored #444

@paskos

Description

@paskos

It was hard to summarize this issue with a small amount of words, I'll use code instead.

My ResourceServer and AuthorizationServer are running in the same JVM.
My ResourceServer only protects "/rest/**" based urls, "/api-docs" url is not to be considered a protected resource.
My subclass of ResourceServerConfigurerAdapter defines

 @Override
    public void configure( HttpSecurity http ) throws Exception
    {
        http.requestMatchers().antMatchers("/rest/**" )
      [...]
    }

The problem is that when a request comes in with "/api-docs" path the security filter chain for the resource server is still triggered.
After debugging I found that my http.requestMatchers().antMatchers("/rest/**" )config is ignored because the actual RequestMatcheris a OrRequestMatcher combining NotOAuthRequestMatcher OR http.requestMatchers().antMatchers("/rest/**" ) which returns true in case of "/api-docs" incoming request.

I wonder is there a way or changing the OrRequestMatcher for an AndRequestMatcher using configuration ?

Thanks in advance

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions