Custom strategy Oauth authentication using Passport JS Custom strategy Oauth authentication using Passport JS express express

Custom strategy Oauth authentication using Passport JS


In your case, you could use bearer token or JWT. Once user success to authenticated, the endpoint could return token in JSON format and then you can store it in local. The use of bearer or JWT token it allow session less authenticate, which mean that the token will contain information about expiry and user id.

I suggest that you should use passport and pick the strategy that fit your need, other than reimplement it.

Passport JWT

Passport Bearer Token