Custom Authentication Handler not handling invalid login-token properly
I have a similar issue to this one just slightly different.
We have a custom Authentication Handler that implements AuthenticationHandler. In the extractCredentials method, the first thing that happens is a check for an existing login-token. If it exists, the method returns null to bypass the rest of the authentication code.
The issue we are running into is when the login-token exists but is no longer valid, the user receives a 403 error.
How can we check for existing AND VALID login-token?
Also where can I see the OOTB SamlAuthenticationHandler code? It sounds like there may be a working example of this case in that code.