Home » Javascript » javascript – Check what type of token is provided in node.js

javascript – Check what type of token is provided in node.js

Posted by: admin February 24, 2020 Leave a comment

Questions:

Currently we are implementing Basic auth on our server. Where server already has JWT implemented its working fine…now our server server raises error when JWT validator founds Basic Auth token saying JWT malformed..its fine thats how JWT works. What i am looking for way to know what type token is passed to my server regardless of token implementation in our server. Say if Basic Auth token is passed than server could say that its Basic Auth..if Bearer Token is passed than server should say its Bearer token..i want fullproof method which can return me type of token passed to it.

How to&Answers: