Explaining the authentication interceptor
In an enterprise application, authentication is a very important process and this can be done using many techniques. In Java EE 8, one of these techniques is the interceptor pattern.
The interceptor pattern is an advanced programming technique that makes it possible to intercept an object call and process algorithms before or after processing the call. This works as aspect-oriented programming (AOP), which makes it possible to include behavior in a process without altering its logic. To implement this using Java EE 8, we can use either the EJB interceptor or the CDI interceptor. We can also select which kind of interceptor to use, depending on whether we are intercepting an EJB class/method or a CDI class/method.
The authentication interceptor is a technique that uses an interceptor pattern either through an EJB interceptor or a CDI interceptor. This is done to add authentication logic before or after using the business logic aspect of oriented programming...