Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring Boot and OAuth2, WebSecurityConfigurerAdapter vs ResourceServerConfigurerAdapter

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?

like image 625
Nikola Lošić Avatar asked Jun 26 '16 00:06

Nikola Lošić


1 Answers

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.

like image 81
Ishara Samantha Avatar answered Oct 19 '22 05:10

Ishara Samantha