Hi @Anmol_Bhardwaj, thank you for the reply,
Would go for building a class (which import session) under core and trigger it in custom login.jsp. (I suppose this is what you talked about)
As to failure token you mentioned, Is using SAML2.0 sign in the only way to get failure token?