This module lets you authenticate without passwords using Authentiq ID in your Node.js applications. By plugging into Passport, Authentiq authentication can be easily and unobtrusively integrated into any application or framework that supports Connect-style middleware, including Express.
npm install passport passport-authentiq
Create an Application
passport-authentiq, you must register an application with Authentiq. If you have not already done so, a new application can be created at the Authentiq Dashboard.
Your application will be issued a Client ID and Client Secret, that need to be provided to the strategy. You will also need to configure a callback URL which matches the route in your application.
To configure the strategy the
clientSecret obtained previously need to be supplied as parameters.
callbackURL is the URL to which Authentiq will redirect the user after granting authorization.
scope parameter specifies what identity claims to request from the user. Valid scopes include
openid scope is added automatically. Appending
~rs to the
phone scope to ensure those claims are always verified.
var AuthentiqStrategy = Strategy;passport;
The strategy will call the provided
verify callback identity information received form the authorization server.
In the above example, the callback accepts
sub and the profile of the user, but there are several other callback signatures available:
function (iss, sub, profile, accessToken, refreshToken, params, done)function (iss, sub, profile, accessToken, refreshToken, done)function(iss, sub, profile, done)function(iss, sub, done)
The callback must call
done to complete the authentication.
passport.authenticate(), specifying the
authentiq strategy, to authenticate requests.
For example, as route middleware in an Express application:
See here for a boilerplate Express application. You will need the following dependencies
npm install express express-session
The test suite is located in the
test/ directory. All new features are expected to have corresponding test cases. Ensure that the complete test suite passes by executing:
make test-covmake view-cov
© 2017 Authentiq