0

I have a spring boot application with spring security. It works fine.

  1. I call HTTP://localhost:8080/test request
  2. AuthenticationProvider catches this request and authenticates the user.
  3. MyController starts working

Now I need to add license checking to this chain.

  1. I call HTTP://localhost:8080/test request
  2. AuthenticationProvider catches this request and authenticates the user.
  3. Somebody checks the license and redirect to the next step or returns an exception
  4. if the 3-th step is a success - MyController starts working

I need to understand who is Somebody on 3-th step - Interceptor, Filter, or something else?

Pavel Petrashov
  • 1,073
  • 1
  • 15
  • 34
  • https://stackoverflow.com/questions/35856454/difference-between-interceptor-and-filter-in-spring-mvc#:~:text=As%20I%20understood%20from%20docs,but%20after%20Controller%20rendered%20response. Filter should be your to go here – Amir Schnell Dec 08 '20 at 09:22

1 Answers1

0

I would create a CustomAuthenticationProvider that is using the underlying default functionality for authentication and additionally does your licence checking.

jan_tm
  • 179
  • 1
  • 6