Part 3 - Using keycloak APIs to generate token, check the validity, and logout the user.