Featherjs authentication: Login using OTP

361 Views Asked by At

I'm using local strategy for authentication purpose using featherjs framework.

Besides username and password auth mechanism, client wants to login using username and OTP. Can someone provide me hint, how can I achieve this? I've studied existing framework featherjs-authentication, I could not understand how can I extend it to support this need.

1

There are 1 best solutions below

0
On

I could solve the problem using package feathers-authentication-custom

It gives you a hook wherein you can add your auth verifier. In my case, I keep OTP associated with user id. When user calls authenticate with custom strategy, the verifier middleware gets called. Here I verify the OTP and pass back the token to the client.