Homepage and Logout

Get introduced to the servlets displaying the homepage and handling the logout.

We'll cover the following

Display the homepage

After the user has been authenticated, meaning the tokens exist, the Auth0Filter will allow them to access our protected resources. This is handled by the doFilter method in the Auth0Filter.

In the widget below, you can see the doGet method in the HomeServlet. The tokens are obtained from the request’s session (lines 3–4) and set as the userId attribute (lines 5–9) so they can be used from the JSP code (line 10).

Get hands-on with 1200+ tech skills courses.