{"id":15228,"date":"2019-10-09T16:26:32","date_gmt":"2019-10-09T09:26:32","guid":{"rendered":"https:\/\/huongdanjava.com\/?p=15228"},"modified":"2021-09-27T06:25:07","modified_gmt":"2021-09-26T23:25:07","slug":"overview-about-request-processing-in-spring-security","status":"publish","type":"post","link":"https:\/\/huongdanjava.com\/overview-about-request-processing-in-spring-security.html","title":{"rendered":"Overview about request processing in Spring Security"},"content":{"rendered":"<p>To be able to make authentication and authorization for the requests to the web application, Spring Security must act as an interceptor of these applications. It will intercept and process the requests before those requests are actually processed by the application and return results. In this tutorial, we will find out that before processing the request by application, what does Spring Security do!<\/p>\n<p>First, for you to easily imagine, I will create <a href=\"https:\/\/huongdanjava.com\/create-spring-web-application-using-spring-legacy-project-in-spring-tool-suite-3.html\">a new Spring MVC application<\/a> that supports Spring Security as an example:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-15219 size-full\" src=\"https:\/\/huongdanjava.com\/wp-content\/uploads\/2019\/10\/overview-about-request-processing-in-spring-security-1.png\" alt=\"Overview about request processing in Spring Security\" width=\"700\" height=\"859\" \/><\/p>\n<p>with Spring Security dependencies as follows:<\/p>\n<pre class=\"lang:xhtml decode:true \">&lt;dependency&gt;\r\n    &lt;groupId&gt;org.springframework.security&lt;\/groupId&gt;\r\n    &lt;artifactId&gt;spring-security-web&lt;\/artifactId&gt;\r\n    &lt;version&gt;${org.springframework.security-version}&lt;\/version&gt;\r\n&lt;\/dependency&gt;\r\n\r\n&lt;dependency&gt;\r\n    &lt;groupId&gt;org.springframework.security&lt;\/groupId&gt;\r\n    &lt;artifactId&gt;spring-security-config&lt;\/artifactId&gt;\r\n    &lt;version&gt;${org.springframework.security-version}&lt;\/version&gt;\r\n&lt;\/dependency&gt;<\/pre>\n<pre class=\"lang:xhtml decode:true\">&lt;properties&gt;\r\n    ...\r\n    &lt;org.springframework.security-version&gt;5.2.0.RELEASE&lt;\/org.springframework.security-version&gt;\r\n&lt;\/properties&gt;<\/pre>\n<p>The security.xml file has the following content:<\/p>\n<pre class=\"lang:xhtml decode:true\">&lt;beans:beans xmlns=\"http:\/\/www.springframework.org\/schema\/security\"\r\n\txmlns:beans=\"http:\/\/www.springframework.org\/schema\/beans\"\r\n\txmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\"\r\n\txsi:schemaLocation=\"http:\/\/www.springframework.org\/schema\/beans https:\/\/www.springframework.org\/schema\/beans\/spring-beans.xsd\r\nhttp:\/\/www.springframework.org\/schema\/security https:\/\/www.springframework.org\/schema\/security\/spring-security.xsd\"&gt;\r\n\r\n\t&lt;http auto-config=\"true\"&gt;\r\n\t\t&lt;intercept-url pattern=\"\/\" access=\"hasRole('ROLE_USER')\"\/&gt;\r\n\t&lt;\/http&gt;\r\n\r\n\t&lt;user-service&gt;\r\n\t\t&lt;user name=\"khanh\" password=\"{noop}123456\" authorities=\"ROLE_USER\" \/&gt;\r\n\t&lt;\/user-service&gt;\r\n&lt;\/beans:beans&gt;<\/pre>\n<p>This security file defines the user &#8220;khanh&#8221; with the role ROLE_USER to have access to the application with the context path &#8220;\/&#8221;.<\/p>\n<p>Of course, you must also configure the web.xml file to add the Spring Security configuration file.<\/p>\n<pre class=\"lang:xhtml decode:true\">&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\r\n&lt;web-app version=\"2.5\" xmlns=\"http:\/\/java.sun.com\/xml\/ns\/javaee\"\r\n\txmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\"\r\n\txsi:schemaLocation=\"http:\/\/java.sun.com\/xml\/ns\/javaee https:\/\/java.sun.com\/xml\/ns\/javaee\/web-app_2_5.xsd\"&gt;\r\n\r\n\t&lt;!-- The definition of the Root Spring Container shared by all Servlets \r\n\t\tand Filters --&gt;\r\n\t&lt;context-param&gt;\r\n\t\t&lt;param-name&gt;contextConfigLocation&lt;\/param-name&gt;\r\n\t\t&lt;param-value&gt;\/WEB-INF\/spring\/root-context.xml&lt;\/param-value&gt;\r\n\t&lt;\/context-param&gt;\r\n\r\n\t&lt;!-- Creates the Spring Container shared by all Servlets and Filters --&gt;\r\n\t&lt;listener&gt;\r\n\t\t&lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;\/listener-class&gt;\r\n\t&lt;\/listener&gt;\r\n\r\n\t&lt;!-- Processes application requests --&gt;\r\n\t&lt;servlet&gt;\r\n\t\t&lt;servlet-name&gt;appServlet&lt;\/servlet-name&gt;\r\n\t\t&lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;\/servlet-class&gt;\r\n\t\t&lt;init-param&gt;\r\n\t\t\t&lt;param-name&gt;contextConfigLocation&lt;\/param-name&gt;\r\n\t\t\t&lt;param-value&gt;\/WEB-INF\/spring\/appServlet\/servlet-context.xml&lt;\/param-value&gt;\r\n\t\t&lt;\/init-param&gt;\r\n\t\t&lt;load-on-startup&gt;1&lt;\/load-on-startup&gt;\r\n\t&lt;\/servlet&gt;\r\n\r\n\t&lt;!-- Spring Security Filter --&gt;\r\n\t&lt;filter&gt;\r\n\t\t&lt;filter-name&gt;springSecurityFilterChain&lt;\/filter-name&gt;\r\n\t\t&lt;filter-class&gt;org.springframework.web.filter.DelegatingFilterProxy&lt;\/filter-class&gt;\r\n\t&lt;\/filter&gt;\r\n\r\n\t&lt;filter-mapping&gt;\r\n\t\t&lt;filter-name&gt;springSecurityFilterChain&lt;\/filter-name&gt;\r\n\t\t&lt;url-pattern&gt;\/*&lt;\/url-pattern&gt;\r\n\t&lt;\/filter-mapping&gt;\r\n\r\n\t&lt;!-- Loads Spring Security Configuration File --&gt;\r\n\t&lt;context-param&gt;\r\n\t\t&lt;param-name&gt;contextConfigLocation&lt;\/param-name&gt;\r\n\t\t&lt;param-value&gt;\/WEB-INF\/spring\/security.xml&lt;\/param-value&gt;\r\n\t&lt;\/context-param&gt;\r\n\r\n\t&lt;servlet-mapping&gt;\r\n\t\t&lt;servlet-name&gt;appServlet&lt;\/servlet-name&gt;\r\n\t\t&lt;url-pattern&gt;\/&lt;\/url-pattern&gt;\r\n\t&lt;\/servlet-mapping&gt;\r\n\r\n&lt;\/web-app&gt;\r\n<\/pre>\n<p>The first thing I want to say about the request handling process in Spring Security is that we have to talk about the DelegatingFilterProxy class declared in the web.xml file of the application. This is the Java Servlet&#8217;s javax.servlet.Filter interface, which acts as an interceptor, filtering all requests to Java web applications. This class is implemented to be managed by the Spring container.<\/p>\n<p>If you have worked with the Java Servlet Filter, you will know that the doFilter() method in this javax.servlet.Filter interface will help us to add code to handle the interceptor, the DelegatingFilterProxy class also uses the doFilter() method to do this.<\/p>\n<p>If you look at the code of the DelegatingFilterProxy class, you will see, actually in the doFilter() method of the DelegatingFilterProxy class, it does nothing. It only delegates filtering through another class, org.springframework.security.web.FilterChainProxy. The FilterChainProxy class also implements the javax.servlet.Filter interface with the doFilter() method. Specifically, what does the FilterChainProxy class do in doFilter() method, similar to the tutorial in <a href=\"https:\/\/huongdanjava.com\/overview-about-request-processing-in-spring-mvc.html\" target=\"_blank\" rel=\"noopener noreferrer\">Overview about request processing in Spring MVC<\/a>, I will also modify the application project&#8217;s log4j.xml file to log out all the information that Spring Security performs when it authenticates and authorizes!<\/p>\n<p>I will change the level of the loggers for the Spring framework from info to debug in the &#8220;3rdparty Loggers&#8221; section and root logger the priority from warn to debug. I also declared a logger for the org.springframework.security package of Spring Security.<\/p>\n<p>At this time, the content of log4j.xml file will be as follows:<\/p>\n<pre class=\"lang:xhtml decode:true \">&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\r\n&lt;!DOCTYPE log4j:configuration PUBLIC \"-\/\/APACHE\/\/DTD LOG4J 1.2\/\/EN\" \"log4j.dtd\"&gt;\r\n&lt;log4j:configuration xmlns:log4j=\"http:\/\/jakarta.apache.org\/log4j\/\"&gt;\r\n\r\n\t&lt;!-- Appenders --&gt;\r\n\t&lt;appender name=\"console\" class=\"org.apache.log4j.ConsoleAppender\"&gt;\r\n\t\t&lt;param name=\"Target\" value=\"System.out\" \/&gt;\r\n\t\t&lt;layout class=\"org.apache.log4j.PatternLayout\"&gt;\r\n\t\t\t&lt;param name=\"ConversionPattern\" value=\"%-5p: %c - %m%n\" \/&gt;\r\n\t\t&lt;\/layout&gt;\r\n\t&lt;\/appender&gt;\r\n\t\r\n\t&lt;!-- Application Loggers --&gt;\r\n\t&lt;logger name=\"com.huongdanjava.springsecurityworkflow\"&gt;\r\n\t\t&lt;level value=\"info\" \/&gt;\r\n\t&lt;\/logger&gt;\r\n\t\r\n\t&lt;!-- 3rdparty Loggers --&gt;\r\n\t&lt;logger name=\"org.springframework.core\"&gt;\r\n\t\t&lt;level value=\"debug\" \/&gt;\r\n\t&lt;\/logger&gt;\r\n\t\r\n\t&lt;logger name=\"org.springframework.beans\"&gt;\r\n\t\t&lt;level value=\"debug\" \/&gt;\r\n\t&lt;\/logger&gt;\r\n\t\r\n\t&lt;logger name=\"org.springframework.context\"&gt;\r\n\t\t&lt;level value=\"debug\" \/&gt;\r\n\t&lt;\/logger&gt;\r\n\r\n\t&lt;logger name=\"org.springframework.web\"&gt;\r\n\t\t&lt;level value=\"debug\" \/&gt;\r\n\t&lt;\/logger&gt;\r\n\t\r\n\t&lt;logger name=\"org.springframework.security\"&gt;\r\n\t\t&lt;level value=\"debug\" \/&gt;\r\n\t&lt;\/logger&gt;\r\n\r\n\t&lt;!-- Root Logger --&gt;\r\n\t&lt;root&gt;\r\n\t\t&lt;priority value=\"debug\" \/&gt;\r\n\t\t&lt;appender-ref ref=\"console\" \/&gt;\r\n\t&lt;\/root&gt;\r\n\t\r\n&lt;\/log4j:configuration&gt;\r\n<\/pre>\n<p>Now, if you run the application and request to http:\/\/localhost:8080, check the console, you will see the following log lines:<\/p>\n<pre class=\"lang:java decode:true \">DEBUG: org.springframework.security.web.FilterChainProxy - \/ at position 1 of 15 in additional filter chain; firing Filter: 'SecurityContextPersistenceFilter'\r\nDEBUG: org.springframework.security.web.context.HttpSessionSecurityContextRepository - No HttpSession currently exists\r\nDEBUG: org.springframework.security.web.context.HttpSessionSecurityContextRepository - No SecurityContext was available from the HttpSession: null. A new one will be created.\r\nDEBUG: org.springframework.security.web.FilterChainProxy - \/ at position 2 of 15 in additional filter chain; firing Filter: 'WebAsyncManagerIntegrationFilter'\r\nDEBUG: org.springframework.security.web.FilterChainProxy - \/ at position 3 of 15 in additional filter chain; firing Filter: 'HeaderWriterFilter'\r\nDEBUG: org.springframework.security.web.FilterChainProxy - \/ at position 4 of 15 in additional filter chain; firing Filter: 'CsrfFilter'\r\nDEBUG: org.springframework.security.web.FilterChainProxy - \/ at position 5 of 15 in additional filter chain; firing Filter: 'LogoutFilter'\r\nDEBUG: org.springframework.security.web.util.matcher.AntPathRequestMatcher - Request 'GET \/' doesn't match 'POST \/logout'\r\nDEBUG: org.springframework.security.web.FilterChainProxy - \/ at position 6 of 15 in additional filter chain; firing Filter: 'UsernamePasswordAuthenticationFilter'\r\nDEBUG: org.springframework.security.web.util.matcher.AntPathRequestMatcher - Request 'GET \/' doesn't match 'POST \/login'\r\nDEBUG: org.springframework.security.web.FilterChainProxy - \/ at position 7 of 15 in additional filter chain; firing Filter: 'DefaultLoginPageGeneratingFilter'\r\nDEBUG: org.springframework.security.web.FilterChainProxy - \/ at position 8 of 15 in additional filter chain; firing Filter: 'DefaultLogoutPageGeneratingFilter'\r\nDEBUG: org.springframework.security.web.util.matcher.AntPathRequestMatcher - Checking match of request : '\/'; against '\/logout'\r\nDEBUG: org.springframework.security.web.FilterChainProxy - \/ at position 9 of 15 in additional filter chain; firing Filter: 'BasicAuthenticationFilter'\r\nDEBUG: org.springframework.security.web.FilterChainProxy - \/ at position 10 of 15 in additional filter chain; firing Filter: 'RequestCacheAwareFilter'\r\nDEBUG: org.springframework.security.web.savedrequest.HttpSessionRequestCache - saved request doesn't match\r\nDEBUG: org.springframework.security.web.FilterChainProxy - \/ at position 11 of 15 in additional filter chain; firing Filter: 'SecurityContextHolderAwareRequestFilter'\r\nDEBUG: org.springframework.security.web.FilterChainProxy - \/ at position 12 of 15 in additional filter chain; firing Filter: 'AnonymousAuthenticationFilter'\r\nDEBUG: org.springframework.security.web.authentication.AnonymousAuthenticationFilter - Populated SecurityContextHolder with anonymous token: 'org.springframework.security.authentication.AnonymousAuthenticationToken@9ec262f5: Principal: anonymousUser; Credentials: [PROTECTED]; Authenticated: true; Details: org.springframework.security.web.authentication.WebAuthenticationDetails@b364: RemoteIpAddress: 0:0:0:0:0:0:0:1; SessionId: null; Granted Authorities: ROLE_ANONYMOUS'\r\nDEBUG: org.springframework.security.web.FilterChainProxy - \/ at position 13 of 15 in additional filter chain; firing Filter: 'SessionManagementFilter'\r\nDEBUG: org.springframework.security.web.FilterChainProxy - \/ at position 14 of 15 in additional filter chain; firing Filter: 'ExceptionTranslationFilter'\r\nDEBUG: org.springframework.security.web.FilterChainProxy - \/ at position 15 of 15 in additional filter chain; firing Filter: 'FilterSecurityInterceptor'\r\nDEBUG: org.springframework.security.web.access.intercept.FilterSecurityInterceptor - Secure object: FilterInvocation: URL: \/; Attributes: [authenticated]\r\nDEBUG: org.springframework.security.web.access.intercept.FilterSecurityInterceptor - Previously Authenticated: org.springframework.security.authentication.AnonymousAuthenticationToken@9ec262f5: Principal: anonymousUser; Credentials: [PROTECTED]; Authenticated: true; Details: org.springframework.security.web.authentication.WebAuthenticationDetails@b364: RemoteIpAddress: 0:0:0:0:0:0:0:1; SessionId: null; Granted Authorities: ROLE_ANONYMOUS\r\nDEBUG: org.springframework.security.access.vote.AffirmativeBased - Voter: org.springframework.security.web.access.expression.WebExpressionVoter@26633508, returned: -1\r\nDEBUG: org.springframework.security.web.access.ExceptionTranslationFilter - Access is denied (user is anonymous); redirecting to authentication entry point\r\norg.springframework.security.access.AccessDeniedException: Access is denied\r\n\tat org.springframework.security.access.vote.AffirmativeBased.decide(AffirmativeBased.java:84)\r\n\tat org.springframework.security.access.intercept.AbstractSecurityInterceptor.beforeInvocation(AbstractSecurityInterceptor.java:233)\r\n\tat org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:124)\r\n\tat org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:91)\r\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)\r\n\tat org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:119)\r\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)\r\n\tat org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:137)\r\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)\r\n\tat org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111)\r\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)\r\n\tat org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:170)\r\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)\r\n\tat org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63)\r\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)\r\n\tat org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilterInternal(BasicAuthenticationFilter.java:158)\r\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:118)\r\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)\r\n\tat org.springframework.security.web.authentication.ui.DefaultLogoutPageGeneratingFilter.doFilterInternal(DefaultLogoutPageGeneratingFilter.java:52)\r\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:118)\r\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)\r\n\tat org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter.doFilter(DefaultLoginPageGeneratingFilter.java:206)\r\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)\r\n\tat org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:200)\r\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)\r\n\tat org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:116)\r\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)\r\n\tat org.springframework.security.web.csrf.CsrfFilter.doFilterInternal(CsrfFilter.java:100)\r\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:118)\r\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)\r\n\tat org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:74)\r\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:118)\r\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)\r\n\tat org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:56)\r\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:118)\r\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)\r\n\tat org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105)\r\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)\r\n\tat org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:215)\r\n\tat org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:178)\r\n\tat org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:357)\r\n\tat org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:270)\r\n\tat org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1583)\r\n\tat org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:542)\r\n\tat org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)\r\n\tat org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:536)\r\n\tat org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)\r\n\tat org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)\r\n\tat org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1581)\r\n\tat org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)\r\n\tat org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1307)\r\n\tat org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)\r\n\tat org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:482)\r\n\tat org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1549)\r\n\tat org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)\r\n\tat org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1204)\r\n\tat org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)\r\n\tat org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:221)\r\n\tat org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:146)\r\n\tat org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)\r\n\tat org.eclipse.jetty.server.Server.handle(Server.java:494)\r\n\tat org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:374)\r\n\tat org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:268)\r\n\tat org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)\r\n\tat org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)\r\n\tat org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)\r\n\tat org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:782)\r\n\tat org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:918)\r\n\tat java.base\/java.lang.Thread.run(Thread.java:835)\r\nDEBUG: org.springframework.security.web.util.matcher.AntPathRequestMatcher - Request '\/' matched by universal pattern '\/**'\r\nDEBUG: org.springframework.security.web.savedrequest.HttpSessionRequestCache - DefaultSavedRequest added to Session: DefaultSavedRequest[http:\/\/localhost:8080\/]\r\nDEBUG: org.springframework.security.web.access.ExceptionTranslationFilter - Calling Authentication entry point.\r\nDEBUG: org.springframework.security.web.DefaultRedirectStrategy - Redirecting to 'http:\/\/localhost:8080\/login'\r\nDEBUG: org.springframework.security.web.header.writers.HstsHeaderWriter - Not injecting HSTS header since it did not match the requestMatcher org.springframework.security.web.header.writers.HstsHeaderWriter$SecureRequestMatcher@4d606c29\r\nDEBUG: org.springframework.security.web.context.HttpSessionSecurityContextRepository - SecurityContext is empty or contents are anonymous - context will not be stored in HttpSession.\r\nDEBUG: org.springframework.security.web.context.SecurityContextPersistenceFilter - SecurityContextHolder now cleared, as request processing completed\r\nDEBUG: org.springframework.security.web.FilterChainProxy - \/login at position 1 of 15 in additional filter chain; firing Filter: 'SecurityContextPersistenceFilter'\r\nDEBUG: org.springframework.security.web.context.HttpSessionSecurityContextRepository - HttpSession returned null object for SPRING_SECURITY_CONTEXT\r\nDEBUG: org.springframework.security.web.context.HttpSessionSecurityContextRepository - No SecurityContext was available from the HttpSession: Session@739e3a15{id=node0btk0fs8h0vtwssmqykcwsbl40,x=node0btk0fs8h0vtwssmqykcwsbl40.node0,req=1,res=true}. A new one will be created.\r\nDEBUG: org.springframework.security.web.FilterChainProxy - \/login at position 2 of 15 in additional filter chain; firing Filter: 'WebAsyncManagerIntegrationFilter'\r\nDEBUG: org.springframework.security.web.FilterChainProxy - \/login at position 3 of 15 in additional filter chain; firing Filter: 'HeaderWriterFilter'\r\nDEBUG: org.springframework.security.web.FilterChainProxy - \/login at position 4 of 15 in additional filter chain; firing Filter: 'CsrfFilter'\r\nDEBUG: org.springframework.security.web.FilterChainProxy - \/login at position 5 of 15 in additional filter chain; firing Filter: 'LogoutFilter'\r\nDEBUG: org.springframework.security.web.util.matcher.AntPathRequestMatcher - Request 'GET \/login' doesn't match 'POST \/logout'\r\nDEBUG: org.springframework.security.web.FilterChainProxy - \/login at position 6 of 15 in additional filter chain; firing Filter: 'UsernamePasswordAuthenticationFilter'\r\nDEBUG: org.springframework.security.web.util.matcher.AntPathRequestMatcher - Request 'GET \/login' doesn't match 'POST \/login'\r\nDEBUG: org.springframework.security.web.FilterChainProxy - \/login at position 7 of 15 in additional filter chain; firing Filter: 'DefaultLoginPageGeneratingFilter'\r\nDEBUG: org.springframework.security.web.header.writers.HstsHeaderWriter - Not injecting HSTS header since it did not match the requestMatcher org.springframework.security.web.header.writers.HstsHeaderWriter$SecureRequestMatcher@4d606c29\r\nDEBUG: org.springframework.security.web.context.HttpSessionSecurityContextRepository - SecurityContext is empty or contents are anonymous - context will not be stored in HttpSession.\r\nDEBUG: org.springframework.security.web.context.SecurityContextPersistenceFilter - SecurityContextHolder now cleared, as request processing completed\r\nDEBUG: org.springframework.security.web.FilterChainProxy - \/favicon.ico at position 1 of 15 in additional filter chain; firing Filter: 'SecurityContextPersistenceFilter'\r\nDEBUG: org.springframework.security.web.context.HttpSessionSecurityContextRepository - HttpSession returned null object for SPRING_SECURITY_CONTEXT\r\nDEBUG: org.springframework.security.web.context.HttpSessionSecurityContextRepository - No SecurityContext was available from the HttpSession: Session@739e3a15{id=node0btk0fs8h0vtwssmqykcwsbl40,x=node0btk0fs8h0vtwssmqykcwsbl40.node0,req=1,res=true}. A new one will be created.\r\nDEBUG: org.springframework.security.web.FilterChainProxy - \/favicon.ico at position 2 of 15 in additional filter chain; firing Filter: 'WebAsyncManagerIntegrationFilter'\r\nDEBUG: org.springframework.security.web.FilterChainProxy - \/favicon.ico at position 3 of 15 in additional filter chain; firing Filter: 'HeaderWriterFilter'\r\nDEBUG: org.springframework.security.web.FilterChainProxy - \/favicon.ico at position 4 of 15 in additional filter chain; firing Filter: 'CsrfFilter'\r\nDEBUG: org.springframework.security.web.FilterChainProxy - \/favicon.ico at position 5 of 15 in additional filter chain; firing Filter: 'LogoutFilter'\r\nDEBUG: org.springframework.security.web.util.matcher.AntPathRequestMatcher - Request 'GET \/favicon.ico' doesn't match 'POST \/logout'\r\nDEBUG: org.springframework.security.web.FilterChainProxy - \/favicon.ico at position 6 of 15 in additional filter chain; firing Filter: 'UsernamePasswordAuthenticationFilter'\r\nDEBUG: org.springframework.security.web.util.matcher.AntPathRequestMatcher - Request 'GET \/favicon.ico' doesn't match 'POST \/login'\r\nDEBUG: org.springframework.security.web.FilterChainProxy - \/favicon.ico at position 7 of 15 in additional filter chain; firing Filter: 'DefaultLoginPageGeneratingFilter'\r\nDEBUG: org.springframework.security.web.FilterChainProxy - \/favicon.ico at position 8 of 15 in additional filter chain; firing Filter: 'DefaultLogoutPageGeneratingFilter'\r\nDEBUG: org.springframework.security.web.util.matcher.AntPathRequestMatcher - Checking match of request : '\/favicon.ico'; against '\/logout'\r\nDEBUG: org.springframework.security.web.FilterChainProxy - \/favicon.ico at position 9 of 15 in additional filter chain; firing Filter: 'BasicAuthenticationFilter'\r\nDEBUG: org.springframework.security.web.FilterChainProxy - \/favicon.ico at position 10 of 15 in additional filter chain; firing Filter: 'RequestCacheAwareFilter'\r\nDEBUG: org.springframework.security.web.savedrequest.DefaultSavedRequest - pathInfo: both null (property equals)\r\nDEBUG: org.springframework.security.web.savedrequest.DefaultSavedRequest - queryString: both null (property equals)\r\nDEBUG: org.springframework.security.web.savedrequest.DefaultSavedRequest - requestURI: arg1=\/; arg2=\/favicon.ico (property not equals)\r\nDEBUG: org.springframework.security.web.savedrequest.HttpSessionRequestCache - saved request doesn't match\r\nDEBUG: org.springframework.security.web.FilterChainProxy - \/favicon.ico at position 11 of 15 in additional filter chain; firing Filter: 'SecurityContextHolderAwareRequestFilter'\r\nDEBUG: org.springframework.security.web.FilterChainProxy - \/favicon.ico at position 12 of 15 in additional filter chain; firing Filter: 'AnonymousAuthenticationFilter'\r\nDEBUG: org.springframework.security.web.authentication.AnonymousAuthenticationFilter - Populated SecurityContextHolder with anonymous token: 'org.springframework.security.authentication.AnonymousAuthenticationToken@a9fd396d: Principal: anonymousUser; Credentials: [PROTECTED]; Authenticated: true; Details: org.springframework.security.web.authentication.WebAuthenticationDetails@ffff4c9c: RemoteIpAddress: 0:0:0:0:0:0:0:1; SessionId: node0btk0fs8h0vtwssmqykcwsbl40; Granted Authorities: ROLE_ANONYMOUS'\r\nDEBUG: org.springframework.security.web.FilterChainProxy - \/favicon.ico at position 13 of 15 in additional filter chain; firing Filter: 'SessionManagementFilter'\r\nDEBUG: org.springframework.security.web.FilterChainProxy - \/favicon.ico at position 14 of 15 in additional filter chain; firing Filter: 'ExceptionTranslationFilter'\r\nDEBUG: org.springframework.security.web.FilterChainProxy - \/favicon.ico at position 15 of 15 in additional filter chain; firing Filter: 'FilterSecurityInterceptor'\r\nDEBUG: org.springframework.security.web.access.intercept.FilterSecurityInterceptor - Secure object: FilterInvocation: URL: \/favicon.ico; Attributes: [authenticated]\r\nDEBUG: org.springframework.security.web.access.intercept.FilterSecurityInterceptor - Previously Authenticated: org.springframework.security.authentication.AnonymousAuthenticationToken@a9fd396d: Principal: anonymousUser; Credentials: [PROTECTED]; Authenticated: true; Details: org.springframework.security.web.authentication.WebAuthenticationDetails@ffff4c9c: RemoteIpAddress: 0:0:0:0:0:0:0:1; SessionId: node0btk0fs8h0vtwssmqykcwsbl40; Granted Authorities: ROLE_ANONYMOUS\r\nDEBUG: org.springframework.security.access.vote.AffirmativeBased - Voter: org.springframework.security.web.access.expression.WebExpressionVoter@26633508, returned: -1\r\nDEBUG: org.springframework.security.web.access.ExceptionTranslationFilter - Access is denied (user is anonymous); redirecting to authentication entry point\r\norg.springframework.security.access.AccessDeniedException: Access is denied\r\n\tat org.springframework.security.access.vote.AffirmativeBased.decide(AffirmativeBased.java:84)\r\n\tat org.springframework.security.access.intercept.AbstractSecurityInterceptor.beforeInvocation(AbstractSecurityInterceptor.java:233)\r\n\tat org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:124)\r\n\tat org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:91)\r\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)\r\n\tat org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:119)\r\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)\r\n\tat org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:137)\r\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)\r\n\tat org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111)\r\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)\r\n\tat org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:170)\r\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)\r\n\tat org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63)\r\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)\r\n\tat org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilterInternal(BasicAuthenticationFilter.java:158)\r\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:118)\r\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)\r\n\tat org.springframework.security.web.authentication.ui.DefaultLogoutPageGeneratingFilter.doFilterInternal(DefaultLogoutPageGeneratingFilter.java:52)\r\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:118)\r\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)\r\n\tat org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter.doFilter(DefaultLoginPageGeneratingFilter.java:206)\r\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)\r\n\tat org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:200)\r\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)\r\n\tat org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:116)\r\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)\r\n\tat org.springframework.security.web.csrf.CsrfFilter.doFilterInternal(CsrfFilter.java:100)\r\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:118)\r\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)\r\n\tat org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:74)\r\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:118)\r\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)\r\n\tat org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:56)\r\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:118)\r\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)\r\n\tat org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105)\r\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)\r\n\tat org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:215)\r\n\tat org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:178)\r\n\tat org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:357)\r\n\tat org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:270)\r\n\tat org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1583)\r\n\tat org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:542)\r\n\tat org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)\r\n\tat org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:536)\r\n\tat org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)\r\n\tat org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)\r\n\tat org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1581)\r\n\tat org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)\r\n\tat org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1307)\r\n\tat org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)\r\n\tat org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:482)\r\n\tat org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1549)\r\n\tat org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)\r\n\tat org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1204)\r\n\tat org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)\r\n\tat org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:221)\r\n\tat org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:146)\r\n\tat org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)\r\n\tat org.eclipse.jetty.server.Server.handle(Server.java:494)\r\n\tat org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:374)\r\n\tat org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:268)\r\n\tat org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)\r\n\tat org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)\r\n\tat org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)\r\n\tat org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336)\r\n\tat org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313)\r\n\tat org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171)\r\n\tat org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.produce(EatWhatYouKill.java:135)\r\n\tat org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:782)\r\n\tat org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:918)\r\n\tat java.base\/java.lang.Thread.run(Thread.java:835)\r\nDEBUG: org.springframework.security.web.util.matcher.AntPathRequestMatcher - Request '\/favicon.ico' matched by universal pattern '\/**'\r\nDEBUG: org.springframework.security.web.savedrequest.HttpSessionRequestCache - DefaultSavedRequest added to Session: DefaultSavedRequest[http:\/\/localhost:8080\/favicon.ico]\r\nDEBUG: org.springframework.security.web.access.ExceptionTranslationFilter - Calling Authentication entry point.\r\nDEBUG: org.springframework.security.web.DefaultRedirectStrategy - Redirecting to 'http:\/\/localhost:8080\/login'\r\nDEBUG: org.springframework.security.web.header.writers.HstsHeaderWriter - Not injecting HSTS header since it did not match the requestMatcher org.springframework.security.web.header.writers.HstsHeaderWriter$SecureRequestMatcher@4d606c29\r\nDEBUG: org.springframework.security.web.context.HttpSessionSecurityContextRepository - SecurityContext is empty or contents are anonymous - context will not be stored in HttpSession.\r\nDEBUG: org.springframework.security.web.context.SecurityContextPersistenceFilter - SecurityContextHolder now cleared, as request processing completed\r\nDEBUG: org.springframework.security.web.FilterChainProxy - \/login at position 1 of 15 in additional filter chain; firing Filter: 'SecurityContextPersistenceFilter'\r\nDEBUG: org.springframework.security.web.context.HttpSessionSecurityContextRepository - HttpSession returned null object for SPRING_SECURITY_CONTEXT\r\nDEBUG: org.springframework.security.web.context.HttpSessionSecurityContextRepository - No SecurityContext was available from the HttpSession: Session@739e3a15{id=node0btk0fs8h0vtwssmqykcwsbl40,x=node0btk0fs8h0vtwssmqykcwsbl40.node0,req=1,res=true}. A new one will be created.\r\nDEBUG: org.springframework.security.web.FilterChainProxy - \/login at position 2 of 15 in additional filter chain; firing Filter: 'WebAsyncManagerIntegrationFilter'\r\nDEBUG: org.springframework.security.web.FilterChainProxy - \/login at position 3 of 15 in additional filter chain; firing Filter: 'HeaderWriterFilter'\r\nDEBUG: org.springframework.security.web.FilterChainProxy - \/login at position 4 of 15 in additional filter chain; firing Filter: 'CsrfFilter'\r\nDEBUG: org.springframework.security.web.FilterChainProxy - \/login at position 5 of 15 in additional filter chain; firing Filter: 'LogoutFilter'\r\nDEBUG: org.springframework.security.web.util.matcher.AntPathRequestMatcher - Request 'GET \/login' doesn't match 'POST \/logout'\r\nDEBUG: org.springframework.security.web.FilterChainProxy - \/login at position 6 of 15 in additional filter chain; firing Filter: 'UsernamePasswordAuthenticationFilter'\r\nDEBUG: org.springframework.security.web.util.matcher.AntPathRequestMatcher - Request 'GET \/login' doesn't match 'POST \/login'\r\nDEBUG: org.springframework.security.web.FilterChainProxy - \/login at position 7 of 15 in additional filter chain; firing Filter: 'DefaultLoginPageGeneratingFilter'\r\nDEBUG: org.springframework.security.web.header.writers.HstsHeaderWriter - Not injecting HSTS header since it did not match the requestMatcher org.springframework.security.web.header.writers.HstsHeaderWriter$SecureRequestMatcher@4d606c29\r\nDEBUG: org.springframework.security.web.context.HttpSessionSecurityContextRepository - SecurityContext is empty or contents are anonymous - context will not be stored in HttpSession.\r\nDEBUG: org.springframework.security.web.context.SecurityContextPersistenceFilter - SecurityContextHolder now cleared, as request processing completed\r\n<\/pre>\n<p>Looking at the above loglines, you can see, with our config in the security.xml file, when calling the request to the home page of the application, there are 15 Filter classes called by the FilterChainProxy class to Spring Security that can carry out its responsibilities. Each filter has its own function and task, and if you look at the code of the UsernamePasswordAuthenticationFilter class and the BasicAuthenticationFilter class, you will see that these two classes will take care of the authentication handling in Spring Security. UsernamePasswordAuthenticationFilter will take care of authentication when the user calls the POST request &#8220;\/login&#8221; and BasicAuthenticationFilter will take care of authentication with user and password information passed on the request header. Both of these filters call the authenticate() method of the AuthenticationManager interface to perform authentication.<\/p>\n<p>In addition to the AuthenticationManager interface, the common implementation of this interface is the ProviderManager class. The ProviderManager class will call a list of AuthenticationProvider which we declared in Spring Security&#8217;s configuration file, security.xml:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-15324 size-full\" src=\"https:\/\/huongdanjava.com\/wp-content\/uploads\/2019\/10\/overview-about-request-processing-in-spring-security-6.png\" alt=\"Overview about request processing in Spring Security\" width=\"700\" height=\"544\" \/><\/p>\n<p>to check the support of these AuthenticationProvider and perform authentication.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-15221 size-full\" src=\"https:\/\/huongdanjava.com\/wp-content\/uploads\/2019\/10\/overview-about-request-processing-in-spring-security-3.png\" alt=\"Overview about request processing in Spring Security\" width=\"700\" height=\"491\" \/><\/p>\n<p>By default, the DaoAuthenticationProvider class will take care of authentication. It will use the UserDetailsService class to get the user information that we declared in the security.xml configuration file to do this.<\/p>\n<p>Details of the authentication, you can read more code! I can overview the authentication in Spring Security as follows:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-16765 size-full\" src=\"https:\/\/huongdanjava.com\/wp-content\/uploads\/2019\/10\/overview-about-request-processing-in-spring-security-5-1.png\" alt=\"Overview about request processing in Spring Security\" width=\"700\" height=\"346\" \/><br \/>\n<script async src=\"\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js\"><\/script><br \/>\n<ins class=\"adsbygoogle\" style=\"display: block; text-align: center;\" data-ad-layout=\"in-article\" data-ad-format=\"fluid\" data-ad-client=\"ca-pub-7304065639390615\" data-ad-slot=\"6822390817\"><\/ins><br \/>\n<script>\n     (adsbygoogle = window.adsbygoogle || []).push({});\n<\/script><br \/>\nTo see how authorization works, try clearing the stack trace of the IDE and logging in with the username &#8220;Khanh&#8221; and the password &#8220;123456&#8221;.<\/p>\n<p>You&#8217;ll see the following log lines:<\/p>\n<pre class=\"lang:java decode:true\">DEBUG: org.springframework.security.web.FilterChainProxy - \/login at position 1 of 15 in additional filter chain; firing Filter: 'SecurityContextPersistenceFilter'\r\nDEBUG: org.springframework.security.web.context.HttpSessionSecurityContextRepository - HttpSession returned null object for SPRING_SECURITY_CONTEXT\r\nDEBUG: org.springframework.security.web.context.HttpSessionSecurityContextRepository - No SecurityContext was available from the HttpSession: Session@554fe819{id=node01dlwnsmhllu3k1vq2k3wdlfxr00,x=node01dlwnsmhllu3k1vq2k3wdlfxr00.node0,req=1,res=true}. A new one will be created.\r\nDEBUG: org.springframework.security.web.FilterChainProxy - \/login at position 2 of 15 in additional filter chain; firing Filter: 'WebAsyncManagerIntegrationFilter'\r\nDEBUG: org.springframework.security.web.FilterChainProxy - \/login at position 3 of 15 in additional filter chain; firing Filter: 'HeaderWriterFilter'\r\nDEBUG: org.springframework.security.web.FilterChainProxy - \/login at position 4 of 15 in additional filter chain; firing Filter: 'CsrfFilter'\r\nDEBUG: org.springframework.security.web.FilterChainProxy - \/login at position 5 of 15 in additional filter chain; firing Filter: 'LogoutFilter'\r\nDEBUG: org.springframework.security.web.util.matcher.AntPathRequestMatcher - Checking match of request : '\/login'; against '\/logout'\r\nDEBUG: org.springframework.security.web.FilterChainProxy - \/login at position 6 of 15 in additional filter chain; firing Filter: 'UsernamePasswordAuthenticationFilter'\r\nDEBUG: org.springframework.security.web.util.matcher.AntPathRequestMatcher - Checking match of request : '\/login'; against '\/login'\r\nDEBUG: org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter - Request is to process authentication\r\nDEBUG: org.springframework.security.authentication.ProviderManager - Authentication attempt using org.springframework.security.authentication.dao.DaoAuthenticationProvider\r\nDEBUG: org.springframework.security.web.authentication.session.CompositeSessionAuthenticationStrategy - Delegating to org.springframework.security.web.csrf.CsrfAuthenticationStrategy@67922932\r\nDEBUG: org.springframework.security.web.authentication.session.CompositeSessionAuthenticationStrategy - Delegating to org.springframework.security.web.authentication.session.ChangeSessionIdAuthenticationStrategy@33a4a533\r\nDEBUG: org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter - Authentication success. Updating SecurityContextHolder to contain: org.springframework.security.authentication.UsernamePasswordAuthenticationToken@bdf25ac6: Principal: org.springframework.security.core.userdetails.User@614935e: Username: khanh; Password: [PROTECTED]; Enabled: true; AccountNonExpired: true; credentialsNonExpired: true; AccountNonLocked: true; Granted Authorities: ROLE_USER; Credentials: [PROTECTED]; Authenticated: true; Details: org.springframework.security.web.authentication.WebAuthenticationDetails@fffbcba8: RemoteIpAddress: 0:0:0:0:0:0:0:1; SessionId: node01dlwnsmhllu3k1vq2k3wdlfxr00; Granted Authorities: ROLE_USER\r\nDEBUG: org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler - Redirecting to DefaultSavedRequest Url: http:\/\/localhost:8080\/\r\nDEBUG: org.springframework.security.web.DefaultRedirectStrategy - Redirecting to 'http:\/\/localhost:8080\/'\r\nDEBUG: org.springframework.security.web.header.writers.HstsHeaderWriter - Not injecting HSTS header since it did not match the requestMatcher org.springframework.security.web.header.writers.HstsHeaderWriter$SecureRequestMatcher@7a583b0b\r\nDEBUG: org.springframework.security.web.context.HttpSessionSecurityContextRepository - SecurityContext 'org.springframework.security.core.context.SecurityContextImpl@bdf25ac6: Authentication: org.springframework.security.authentication.UsernamePasswordAuthenticationToken@bdf25ac6: Principal: org.springframework.security.core.userdetails.User@614935e: Username: khanh; Password: [PROTECTED]; Enabled: true; AccountNonExpired: true; credentialsNonExpired: true; AccountNonLocked: true; Granted Authorities: ROLE_USER; Credentials: [PROTECTED]; Authenticated: true; Details: org.springframework.security.web.authentication.WebAuthenticationDetails@fffbcba8: RemoteIpAddress: 0:0:0:0:0:0:0:1; SessionId: node01dlwnsmhllu3k1vq2k3wdlfxr00; Granted Authorities: ROLE_USER' stored to HttpSession: 'Session@554fe819{id=node01dgz9l49ieu4o1thv3a3u2zega1,x=node01dgz9l49ieu4o1thv3a3u2zega1.node0,req=1,res=true}\r\nDEBUG: org.springframework.security.web.context.SecurityContextPersistenceFilter - SecurityContextHolder now cleared, as request processing completed\r\nDEBUG: org.springframework.security.web.FilterChainProxy - \/ at position 1 of 15 in additional filter chain; firing Filter: 'SecurityContextPersistenceFilter'\r\nDEBUG: org.springframework.security.web.context.HttpSessionSecurityContextRepository - Obtained a valid SecurityContext from SPRING_SECURITY_CONTEXT: 'org.springframework.security.core.context.SecurityContextImpl@bdf25ac6: Authentication: org.springframework.security.authentication.UsernamePasswordAuthenticationToken@bdf25ac6: Principal: org.springframework.security.core.userdetails.User@614935e: Username: khanh; Password: [PROTECTED]; Enabled: true; AccountNonExpired: true; credentialsNonExpired: true; AccountNonLocked: true; Granted Authorities: ROLE_USER; Credentials: [PROTECTED]; Authenticated: true; Details: org.springframework.security.web.authentication.WebAuthenticationDetails@fffbcba8: RemoteIpAddress: 0:0:0:0:0:0:0:1; SessionId: node01dlwnsmhllu3k1vq2k3wdlfxr00; Granted Authorities: ROLE_USER'\r\nDEBUG: org.springframework.security.web.FilterChainProxy - \/ at position 2 of 15 in additional filter chain; firing Filter: 'WebAsyncManagerIntegrationFilter'\r\nDEBUG: org.springframework.security.web.FilterChainProxy - \/ at position 3 of 15 in additional filter chain; firing Filter: 'HeaderWriterFilter'\r\nDEBUG: org.springframework.security.web.FilterChainProxy - \/ at position 4 of 15 in additional filter chain; firing Filter: 'CsrfFilter'\r\nDEBUG: org.springframework.security.web.FilterChainProxy - \/ at position 5 of 15 in additional filter chain; firing Filter: 'LogoutFilter'\r\nDEBUG: org.springframework.security.web.util.matcher.AntPathRequestMatcher - Request 'GET \/' doesn't match 'POST \/logout'\r\nDEBUG: org.springframework.security.web.FilterChainProxy - \/ at position 6 of 15 in additional filter chain; firing Filter: 'UsernamePasswordAuthenticationFilter'\r\nDEBUG: org.springframework.security.web.util.matcher.AntPathRequestMatcher - Request 'GET \/' doesn't match 'POST \/login'\r\nDEBUG: org.springframework.security.web.FilterChainProxy - \/ at position 7 of 15 in additional filter chain; firing Filter: 'DefaultLoginPageGeneratingFilter'\r\nDEBUG: org.springframework.security.web.FilterChainProxy - \/ at position 8 of 15 in additional filter chain; firing Filter: 'DefaultLogoutPageGeneratingFilter'\r\nDEBUG: org.springframework.security.web.util.matcher.AntPathRequestMatcher - Checking match of request : '\/'; against '\/logout'\r\nDEBUG: org.springframework.security.web.FilterChainProxy - \/ at position 9 of 15 in additional filter chain; firing Filter: 'BasicAuthenticationFilter'\r\nDEBUG: org.springframework.security.web.FilterChainProxy - \/ at position 10 of 15 in additional filter chain; firing Filter: 'RequestCacheAwareFilter'\r\nDEBUG: org.springframework.security.web.savedrequest.DefaultSavedRequest - pathInfo: both null (property equals)\r\nDEBUG: org.springframework.security.web.savedrequest.DefaultSavedRequest - queryString: both null (property equals)\r\nDEBUG: org.springframework.security.web.savedrequest.DefaultSavedRequest - requestURI: arg1=\/; arg2=\/ (property equals)\r\nDEBUG: org.springframework.security.web.savedrequest.DefaultSavedRequest - serverPort: arg1=8080; arg2=8080 (property equals)\r\nDEBUG: org.springframework.security.web.savedrequest.DefaultSavedRequest - requestURL: arg1=http:\/\/localhost:8080\/; arg2=http:\/\/localhost:8080\/ (property equals)\r\nDEBUG: org.springframework.security.web.savedrequest.DefaultSavedRequest - scheme: arg1=http; arg2=http (property equals)\r\nDEBUG: org.springframework.security.web.savedrequest.DefaultSavedRequest - serverName: arg1=localhost; arg2=localhost (property equals)\r\nDEBUG: org.springframework.security.web.savedrequest.DefaultSavedRequest - contextPath: arg1=; arg2= (property equals)\r\nDEBUG: org.springframework.security.web.savedrequest.DefaultSavedRequest - servletPath: arg1=\/; arg2=\/ (property equals)\r\nDEBUG: org.springframework.security.web.savedrequest.HttpSessionRequestCache - Removing DefaultSavedRequest from session if present\r\nDEBUG: org.springframework.security.web.FilterChainProxy - \/ at position 11 of 15 in additional filter chain; firing Filter: 'SecurityContextHolderAwareRequestFilter'\r\nDEBUG: org.springframework.security.web.FilterChainProxy - \/ at position 12 of 15 in additional filter chain; firing Filter: 'AnonymousAuthenticationFilter'\r\nDEBUG: org.springframework.security.web.authentication.AnonymousAuthenticationFilter - SecurityContextHolder not populated with anonymous token, as it already contained: 'org.springframework.security.authentication.UsernamePasswordAuthenticationToken@bdf25ac6: Principal: org.springframework.security.core.userdetails.User@614935e: Username: khanh; Password: [PROTECTED]; Enabled: true; AccountNonExpired: true; credentialsNonExpired: true; AccountNonLocked: true; Granted Authorities: ROLE_USER; Credentials: [PROTECTED]; Authenticated: true; Details: org.springframework.security.web.authentication.WebAuthenticationDetails@fffbcba8: RemoteIpAddress: 0:0:0:0:0:0:0:1; SessionId: node01dlwnsmhllu3k1vq2k3wdlfxr00; Granted Authorities: ROLE_USER'\r\nDEBUG: org.springframework.security.web.FilterChainProxy - \/ at position 13 of 15 in additional filter chain; firing Filter: 'SessionManagementFilter'\r\nDEBUG: org.springframework.security.web.FilterChainProxy - \/ at position 14 of 15 in additional filter chain; firing Filter: 'ExceptionTranslationFilter'\r\nDEBUG: org.springframework.security.web.FilterChainProxy - \/ at position 15 of 15 in additional filter chain; firing Filter: 'FilterSecurityInterceptor'\r\nDEBUG: org.springframework.security.web.access.intercept.FilterSecurityInterceptor - Secure object: FilterInvocation: URL: \/; Attributes: [authenticated]\r\nDEBUG: org.springframework.security.web.access.intercept.FilterSecurityInterceptor - Previously Authenticated: org.springframework.security.authentication.UsernamePasswordAuthenticationToken@bdf25ac6: Principal: org.springframework.security.core.userdetails.User@614935e: Username: khanh; Password: [PROTECTED]; Enabled: true; AccountNonExpired: true; credentialsNonExpired: true; AccountNonLocked: true; Granted Authorities: ROLE_USER; Credentials: [PROTECTED]; Authenticated: true; Details: org.springframework.security.web.authentication.WebAuthenticationDetails@fffbcba8: RemoteIpAddress: 0:0:0:0:0:0:0:1; SessionId: node01dlwnsmhllu3k1vq2k3wdlfxr00; Granted Authorities: ROLE_USER\r\nDEBUG: org.springframework.security.access.vote.AffirmativeBased - Voter: org.springframework.security.web.access.expression.WebExpressionVoter@6522dd1b, returned: 1\r\nDEBUG: org.springframework.security.web.access.intercept.FilterSecurityInterceptor - Authorization successful\r\nDEBUG: org.springframework.security.web.access.intercept.FilterSecurityInterceptor - RunAsManager did not change Authentication object\r\nDEBUG: org.springframework.security.web.FilterChainProxy - \/ reached end of additional filter chain; proceeding with original chain\r\nDEBUG: org.springframework.web.servlet.DispatcherServlet - GET \"\/\", parameters={}\r\nDEBUG: org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping - Mapped to public java.lang.String com.huongdanjava.springsecurityworkflow.HomeController.home(java.util.Locale,org.springframework.ui.Model)\r\nINFO : com.huongdanjava.springsecurityworkflow.HomeController - Welcome home! The client locale is vi.\r\nDEBUG: org.springframework.web.servlet.view.JstlView - View name 'home', model {serverTime=05:34:36 ICT 8 th\u00e1ng 10, 2019}\r\nDEBUG: org.springframework.web.servlet.view.JstlView - Forwarding to [\/WEB-INF\/views\/home.jsp]\r\nDEBUG: org.springframework.security.web.header.writers.HstsHeaderWriter - Not injecting HSTS header since it did not match the requestMatcher org.springframework.security.web.header.writers.HstsHeaderWriter$SecureRequestMatcher@7a583b0b\r\nDEBUG: org.springframework.web.servlet.DispatcherServlet - Completed 200 OK\r\nDEBUG: org.springframework.security.web.access.ExceptionTranslationFilter - Chain processed normally\r\nDEBUG: org.springframework.security.web.context.SecurityContextPersistenceFilter - SecurityContextHolder now cleared, as request processing completed\r\n<\/pre>\n<p>If you look closely at the logs above, you will see the text &#8220;Authorization successful&#8221; and the AffirmativeBased class is the class that implements this authorization!<\/p>\n<p>The AffirmativeBased class implements the AccessDecisionManager interface, this is the main interface for authorization in Spring Security!<\/p>\n<p>AccessDecisionManager inteface has 3 implementations and the implementation that we often use is the AffirmativeBased class.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-15222 size-full\" src=\"https:\/\/huongdanjava.com\/wp-content\/uploads\/2019\/10\/overview-about-request-processing-in-spring-security-4.png\" alt=\"Overview about request processing in Spring Security\" width=\"700\" height=\"543\" \/><\/p>\n<p>If you look at the code of the AffirmativeBased class, you will see in the decide() method of this class, it is looping a list of AccessDecisionVoter to determine whether the user has the right to see the resource they are requesting or not?<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-15223 size-full\" src=\"https:\/\/huongdanjava.com\/wp-content\/uploads\/2019\/10\/overview-about-request-processing-in-spring-security-5.png\" alt=\"Overview about request processing in Spring Security\" width=\"700\" height=\"510\" \/><\/p>\n<p>Read more code, guys! \ud83d\ude42<\/p>\n\n\n<div class=\"kk-star-ratings kksr-auto kksr-align-right kksr-valign-bottom\"\n    data-payload='{&quot;align&quot;:&quot;right&quot;,&quot;id&quot;:&quot;15228&quot;,&quot;slug&quot;:&quot;default&quot;,&quot;valign&quot;:&quot;bottom&quot;,&quot;ignore&quot;:&quot;&quot;,&quot;reference&quot;:&quot;auto&quot;,&quot;class&quot;:&quot;&quot;,&quot;count&quot;:&quot;1&quot;,&quot;legendonly&quot;:&quot;&quot;,&quot;readonly&quot;:&quot;&quot;,&quot;score&quot;:&quot;5&quot;,&quot;starsonly&quot;:&quot;&quot;,&quot;best&quot;:&quot;5&quot;,&quot;gap&quot;:&quot;4&quot;,&quot;greet&quot;:&quot;&quot;,&quot;legend&quot;:&quot;5\\\/5 - (1 vote)&quot;,&quot;size&quot;:&quot;24&quot;,&quot;title&quot;:&quot;Overview about request processing in Spring Security&quot;,&quot;width&quot;:&quot;138&quot;,&quot;_legend&quot;:&quot;{score}\\\/{best} - ({count} {votes})&quot;,&quot;font_factor&quot;:&quot;1.25&quot;}'>\n            \n<div class=\"kksr-stars\">\n    \n<div class=\"kksr-stars-inactive\">\n            <div class=\"kksr-star\" data-star=\"1\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"2\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"3\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"4\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"5\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n    <\/div>\n    \n<div class=\"kksr-stars-active\" style=\"width: 138px;\">\n            <div class=\"kksr-star\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n    <\/div>\n<\/div>\n                \n\n<div class=\"kksr-legend\" style=\"font-size: 19.2px;\">\n            5\/5 - (1 vote)    <\/div>\n    <\/div>\n","protected":false},"excerpt":{"rendered":"<p>To be able to make authentication and authorization for the requests to the web application, Spring Security must act as an interceptor of these applications. It will intercept and process the requests before those requests are actually processed by the application and return results. In&hellip; <a href=\"https:\/\/huongdanjava.com\/overview-about-request-processing-in-spring-security.html\">Read More<\/a><\/p>\n","protected":false},"author":1,"featured_media":14897,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1891],"tags":[],"class_list":["post-15228","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-spring-security","clearfix"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Overview about request processing in Spring Security - Huong Dan Java<\/title>\n<meta name=\"description\" content=\"In this tutorial, I will introduce with you all an overview about request processing in Spring Security.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/huongdanjava.com\/overview-about-request-processing-in-spring-security.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Overview about request processing in Spring Security - Huong Dan Java\" \/>\n<meta property=\"og:description\" content=\"In this tutorial, I will introduce with you all an overview about request processing in Spring Security.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/huongdanjava.com\/overview-about-request-processing-in-spring-security.html\" \/>\n<meta property=\"og:site_name\" content=\"Huong Dan Java\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/nhkhanh2406\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/nhkhanh2406\" \/>\n<meta property=\"article:published_time\" content=\"2019-10-09T09:26:32+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-09-26T23:25:07+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/huongdanjava.com\/wp-content\/uploads\/2019\/08\/spring-security.png\" \/>\n\t<meta property=\"og:image:width\" content=\"200\" \/>\n\t<meta property=\"og:image:height\" content=\"200\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Khanh Nguyen\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/KhanhNguyenJ\" \/>\n<meta name=\"twitter:site\" content=\"@KhanhNguyenJ\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Khanh Nguyen\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"31 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/overview-about-request-processing-in-spring-security.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/overview-about-request-processing-in-spring-security.html\"},\"author\":{\"name\":\"Khanh Nguyen\",\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/#\\\/schema\\\/person\\\/dc859d7f8cbea3b593e6738de9cbb82d\"},\"headline\":\"Overview about request processing in Spring Security\",\"datePublished\":\"2019-10-09T09:26:32+00:00\",\"dateModified\":\"2021-09-26T23:25:07+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/overview-about-request-processing-in-spring-security.html\"},\"wordCount\":794,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/#\\\/schema\\\/person\\\/dc859d7f8cbea3b593e6738de9cbb82d\"},\"image\":{\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/overview-about-request-processing-in-spring-security.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/huongdanjava.com\\\/wp-content\\\/uploads\\\/2019\\\/08\\\/spring-security.png\",\"articleSection\":[\"Spring Security\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/huongdanjava.com\\\/overview-about-request-processing-in-spring-security.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/overview-about-request-processing-in-spring-security.html\",\"url\":\"https:\\\/\\\/huongdanjava.com\\\/overview-about-request-processing-in-spring-security.html\",\"name\":\"Overview about request processing in Spring Security - Huong Dan Java\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/overview-about-request-processing-in-spring-security.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/overview-about-request-processing-in-spring-security.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/huongdanjava.com\\\/wp-content\\\/uploads\\\/2019\\\/08\\\/spring-security.png\",\"datePublished\":\"2019-10-09T09:26:32+00:00\",\"dateModified\":\"2021-09-26T23:25:07+00:00\",\"description\":\"In this tutorial, I will introduce with you all an overview about request processing in Spring Security.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/overview-about-request-processing-in-spring-security.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/huongdanjava.com\\\/overview-about-request-processing-in-spring-security.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/overview-about-request-processing-in-spring-security.html#primaryimage\",\"url\":\"https:\\\/\\\/huongdanjava.com\\\/wp-content\\\/uploads\\\/2019\\\/08\\\/spring-security.png\",\"contentUrl\":\"https:\\\/\\\/huongdanjava.com\\\/wp-content\\\/uploads\\\/2019\\\/08\\\/spring-security.png\",\"width\":200,\"height\":200},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/overview-about-request-processing-in-spring-security.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/huongdanjava.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Overview about request processing in Spring Security\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/#website\",\"url\":\"https:\\\/\\\/huongdanjava.com\\\/\",\"name\":\"Huong Dan Java\",\"description\":\"Java development tutorials\",\"publisher\":{\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/#\\\/schema\\\/person\\\/dc859d7f8cbea3b593e6738de9cbb82d\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/huongdanjava.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/#\\\/schema\\\/person\\\/dc859d7f8cbea3b593e6738de9cbb82d\",\"name\":\"Khanh Nguyen\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/wp-content\\\/uploads\\\/2021\\\/07\\\/CC6FAC58-D227-4DD8-93D1-6D6A795577E3_1_201_a.jpeg\",\"url\":\"https:\\\/\\\/huongdanjava.com\\\/wp-content\\\/uploads\\\/2021\\\/07\\\/CC6FAC58-D227-4DD8-93D1-6D6A795577E3_1_201_a.jpeg\",\"contentUrl\":\"https:\\\/\\\/huongdanjava.com\\\/wp-content\\\/uploads\\\/2021\\\/07\\\/CC6FAC58-D227-4DD8-93D1-6D6A795577E3_1_201_a.jpeg\",\"width\":1267,\"height\":1517,\"caption\":\"Khanh Nguyen\"},\"logo\":{\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/wp-content\\\/uploads\\\/2021\\\/07\\\/CC6FAC58-D227-4DD8-93D1-6D6A795577E3_1_201_a.jpeg\"},\"description\":\"I love Java and everything related to Java.\",\"sameAs\":[\"https:\\\/\\\/huongdanjava.com\",\"https:\\\/\\\/www.facebook.com\\\/nhkhanh2406\",\"https:\\\/\\\/x.com\\\/https:\\\/\\\/twitter.com\\\/KhanhNguyenJ\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Overview about request processing in Spring Security - Huong Dan Java","description":"In this tutorial, I will introduce with you all an overview about request processing in Spring Security.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/huongdanjava.com\/overview-about-request-processing-in-spring-security.html","og_locale":"en_US","og_type":"article","og_title":"Overview about request processing in Spring Security - Huong Dan Java","og_description":"In this tutorial, I will introduce with you all an overview about request processing in Spring Security.","og_url":"https:\/\/huongdanjava.com\/overview-about-request-processing-in-spring-security.html","og_site_name":"Huong Dan Java","article_publisher":"https:\/\/www.facebook.com\/nhkhanh2406","article_author":"https:\/\/www.facebook.com\/nhkhanh2406","article_published_time":"2019-10-09T09:26:32+00:00","article_modified_time":"2021-09-26T23:25:07+00:00","og_image":[{"width":200,"height":200,"url":"https:\/\/huongdanjava.com\/wp-content\/uploads\/2019\/08\/spring-security.png","type":"image\/png"}],"author":"Khanh Nguyen","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/KhanhNguyenJ","twitter_site":"@KhanhNguyenJ","twitter_misc":{"Written by":"Khanh Nguyen","Est. reading time":"31 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/huongdanjava.com\/overview-about-request-processing-in-spring-security.html#article","isPartOf":{"@id":"https:\/\/huongdanjava.com\/overview-about-request-processing-in-spring-security.html"},"author":{"name":"Khanh Nguyen","@id":"https:\/\/huongdanjava.com\/#\/schema\/person\/dc859d7f8cbea3b593e6738de9cbb82d"},"headline":"Overview about request processing in Spring Security","datePublished":"2019-10-09T09:26:32+00:00","dateModified":"2021-09-26T23:25:07+00:00","mainEntityOfPage":{"@id":"https:\/\/huongdanjava.com\/overview-about-request-processing-in-spring-security.html"},"wordCount":794,"commentCount":0,"publisher":{"@id":"https:\/\/huongdanjava.com\/#\/schema\/person\/dc859d7f8cbea3b593e6738de9cbb82d"},"image":{"@id":"https:\/\/huongdanjava.com\/overview-about-request-processing-in-spring-security.html#primaryimage"},"thumbnailUrl":"https:\/\/huongdanjava.com\/wp-content\/uploads\/2019\/08\/spring-security.png","articleSection":["Spring Security"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/huongdanjava.com\/overview-about-request-processing-in-spring-security.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/huongdanjava.com\/overview-about-request-processing-in-spring-security.html","url":"https:\/\/huongdanjava.com\/overview-about-request-processing-in-spring-security.html","name":"Overview about request processing in Spring Security - Huong Dan Java","isPartOf":{"@id":"https:\/\/huongdanjava.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/huongdanjava.com\/overview-about-request-processing-in-spring-security.html#primaryimage"},"image":{"@id":"https:\/\/huongdanjava.com\/overview-about-request-processing-in-spring-security.html#primaryimage"},"thumbnailUrl":"https:\/\/huongdanjava.com\/wp-content\/uploads\/2019\/08\/spring-security.png","datePublished":"2019-10-09T09:26:32+00:00","dateModified":"2021-09-26T23:25:07+00:00","description":"In this tutorial, I will introduce with you all an overview about request processing in Spring Security.","breadcrumb":{"@id":"https:\/\/huongdanjava.com\/overview-about-request-processing-in-spring-security.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/huongdanjava.com\/overview-about-request-processing-in-spring-security.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/huongdanjava.com\/overview-about-request-processing-in-spring-security.html#primaryimage","url":"https:\/\/huongdanjava.com\/wp-content\/uploads\/2019\/08\/spring-security.png","contentUrl":"https:\/\/huongdanjava.com\/wp-content\/uploads\/2019\/08\/spring-security.png","width":200,"height":200},{"@type":"BreadcrumbList","@id":"https:\/\/huongdanjava.com\/overview-about-request-processing-in-spring-security.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/huongdanjava.com\/"},{"@type":"ListItem","position":2,"name":"Overview about request processing in Spring Security"}]},{"@type":"WebSite","@id":"https:\/\/huongdanjava.com\/#website","url":"https:\/\/huongdanjava.com\/","name":"Huong Dan Java","description":"Java development tutorials","publisher":{"@id":"https:\/\/huongdanjava.com\/#\/schema\/person\/dc859d7f8cbea3b593e6738de9cbb82d"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/huongdanjava.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/huongdanjava.com\/#\/schema\/person\/dc859d7f8cbea3b593e6738de9cbb82d","name":"Khanh Nguyen","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/huongdanjava.com\/wp-content\/uploads\/2021\/07\/CC6FAC58-D227-4DD8-93D1-6D6A795577E3_1_201_a.jpeg","url":"https:\/\/huongdanjava.com\/wp-content\/uploads\/2021\/07\/CC6FAC58-D227-4DD8-93D1-6D6A795577E3_1_201_a.jpeg","contentUrl":"https:\/\/huongdanjava.com\/wp-content\/uploads\/2021\/07\/CC6FAC58-D227-4DD8-93D1-6D6A795577E3_1_201_a.jpeg","width":1267,"height":1517,"caption":"Khanh Nguyen"},"logo":{"@id":"https:\/\/huongdanjava.com\/wp-content\/uploads\/2021\/07\/CC6FAC58-D227-4DD8-93D1-6D6A795577E3_1_201_a.jpeg"},"description":"I love Java and everything related to Java.","sameAs":["https:\/\/huongdanjava.com","https:\/\/www.facebook.com\/nhkhanh2406","https:\/\/x.com\/https:\/\/twitter.com\/KhanhNguyenJ"]}]}},"_links":{"self":[{"href":"https:\/\/huongdanjava.com\/wp-json\/wp\/v2\/posts\/15228","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/huongdanjava.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/huongdanjava.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/huongdanjava.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/huongdanjava.com\/wp-json\/wp\/v2\/comments?post=15228"}],"version-history":[{"count":11,"href":"https:\/\/huongdanjava.com\/wp-json\/wp\/v2\/posts\/15228\/revisions"}],"predecessor-version":[{"id":18436,"href":"https:\/\/huongdanjava.com\/wp-json\/wp\/v2\/posts\/15228\/revisions\/18436"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/huongdanjava.com\/wp-json\/wp\/v2\/media\/14897"}],"wp:attachment":[{"href":"https:\/\/huongdanjava.com\/wp-json\/wp\/v2\/media?parent=15228"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/huongdanjava.com\/wp-json\/wp\/v2\/categories?post=15228"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/huongdanjava.com\/wp-json\/wp\/v2\/tags?post=15228"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}