both spring authentication provider and authentication processing filter also need to register with authenticationManager?
authentication provider i can use custom-authentication-provider tag
but what is different spring authentication provider and authentication processing filter ?
The authentication manager uses all authentication providers to authenticate authenticationtokens it has to authenticate.
The authentication processing filter just adds a token (username password). Other filters add tokens too. For example the AnonymousProcessingFilter.
The idea is to seperate token generation from token authentication. That way you could implement stuff like authentication against multiple sources easily.
The regular case is one provider per token generator.
According to Spring Security Architecture the process is:
See an example here: a filter is calling a provider manager to find a provider who supports this authentication and if so the do authenticate
Here you can find a nice example on how to implement a custom filter: Custom filter @Baeldung
Please consider that filters are calling Provider Managers or Providers only if they are coded like that. There's no rule to enforce that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With