In this section, let's try to discuss about filters in spring security, what is the purpose of them?
What are inbuilt filters associated in spring security, how we can write our own custom filters based
upon the business requirements that we have.
So a lot of times we'll have situations outside our regular authentication and authorization inside
our spring security flaw.
One such requirements like I want to do an input validation, whatever the user is giving to me, like
whether his username is valid, whether his passport is valid in terms of data validation that I want
to perform.
And at the same time, we may want to log audit report user details like the IP address that he's trying
to perform, the authentication and authorization, and at the same time, encryption, decryption multifactor
authentication like generating and order verification code.
So all this comes under the use cases, beyond the authorisation and authentication inside any spring
security framework.
So in order to handle such housekeeping activities, we can use it strictly filters available in spring
secret.
As you may know, filters are solid concepts and the same has been leveraged by spring security as well.
In all the previous sections that we discussed, we already saw some inbuilt filters provided by spring
security framework, like whatever we're trying to do, authentication that will be handled by the authentication
filter.
The same applies for authorization.
And if we enable and configure CSIR of cards inside of a spring security, a filter handle such requirements
for you inside the framework.
So basically a filter is a component which receives a request and process your logic, what you have
written inside the filter and hand over the same request and response that it received to the four that
filters in the chain.
So basically we can have multiple chain of filters with an order like one, two, three, four, five,
and those filters will be executed one by one by the framework.
And whenever you are done with execution inside your filter, your filter will hand over to the next
operator in the chain till it reaches to the end of the chain.
Spring security is based upon chain of solid filters like entry.
Spring security framework has been written based upon the filters owlet filters, which we can see in
the next video.
And depending on the configuration that we do, the inbuilt filters will be added or removed.
I suppose if I confess SRF, of course those filters will be activated inside my flow.
Otherwise those filters will not be activated by discipling security framework on top of whatever springs
security framework provides.
In terms of filters, we can also define our own custom filters and add them in the flow of spring security,
authentication and authorization to handle our business housekeeping activities like input, validation,
log tracing, auditing.
I hope this is making sense to you.
I'll catch you in the next video where we can see what are the inbuilt filters provided by spring security.
Thank you.
And by.