8

What is the difference between WebSecurityConfigurerAdapter and ResourceServerConfigurerAdapter and which should have higher precedence?

I don't really see difference if I am both resource owner and the client. I can configureHttpSecurity in both classes.

EDIT:

Which type of matchers should I add in WebSecurityConfigurerAdapter and which in ResourceServerConfigurerAdapter? I found in some examples that WebSecurityConfigurerAdapter matches pages for login, registration etc. and ResourceServerConfigurerAdapter for the real resource. Is that a correct way of doing it?

Nikola Lošić
  • 479
  • 1
  • 6
  • 18

1 Answers1

1

ResourceServerConfigurerAdapter for adjust the access rules and paths that are protected by OAuth2 security (Some additional oauth2 filters activated).

WebSecurityConfigurerAdapter for the basic Spring Security customization.

Ishara Samantha
  • 393
  • 4
  • 8