{"repo":"lughino/passport-unique-token","free":true,"listed":false,"github":"https://github.com/lughino/passport-unique-token","clone":"git clone https://github.com/lughino/passport-unique-token.git","description":"Unique token authentication strategy for Passport","language":"TypeScript","stars":38,"topics":["passport","express","passport-strategy","passport-unique-token","authentication-strategy"],"license":"MIT","category":"auth-billing-email","readme_excerpt":"Passport Unique Token Strategy Unique token authentication strategy for Passport. Installation Usage The unique token authentication strategy authenticates users with a unique token. The strategy requires a verify callback, which accepts these credentials and calls done providing a user. By default passport-unique-token checks for token key credentials in either the params url or request body in these locations: Type Default property ------ :--------------: Url token Body token Query token Header token Configure These credential locations can be configured when defining the strategy as follows: failOnMissing option allows you to queue multiple strategy, customizing the behavior. By default it's set to true , when it's set to false it lets move on to the next strategy on failure. How to Authenticate Use passport.authenticate() , specifying the token strategy to authenticate requests. For example, as route middleware in an Express application: If authentication fails in the above example then a 401 response will be given. However there may be times you wish a bit more control and delegate the failure to your application: Api Reference - UniqueTokenStrategy() - authenticate() UniqueTokenStrategy() The token authentication strategy authenticates requests based on the credentials submitted through standard request headers, body, querystring or params. authenticate() You can optionally pass options to the authenticate() method. Please refer to the passport documentation for the dif","default_branch":null,"files":null,"tree":[],"storefront":"/r/lughino","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/lughino/passport-unique-token/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}