Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
tozny-auth
Advanced tools
Readme
NodeJS SDK for with the Tozny authentication service. Provides functions for making API calls to Tozny, and a Passport strategy for easily adding Tozny support to any Express app.
Passport is an authentication framework for Express. Using Passport, you can add Tozny support to your app by instantiating the Tozny strategy:
var passport = require('passport')
, tozny = require('tozny-auth');
var realm = new tozny.Realm(realmKeyId, realmSecret, apiUrl);
passport.use(new tozny.Strategy(realm));
Then create a login handler using passport:
app.post('/login',
passport.authenticate('tozny', {
successRedirect: '/',
failureRedirect: '/login'
}));
There are some more details required to get Passport fully set up. See examples/secretmessage/index.js for a documented, working example.
This library includes detailed documentation for API functions, generated from source file comments. The documentation is built using jsduck, which you will need to install.
Run the command:
npm run doc
Then view the documentation by opening doc/index.html
.
Install project dependencies:
npm install
Then run the tests:
npm test
Some of the tests included run against a live Tozny instance. To run those tests, it is necessary to set environment variables with credentials for making Tozny API requests. To run the complete test suite, set these environment variables:
REALM_KEY_ID
SECRET
API_URL
USER_ID
The USER_ID
variable may correspond to any user record in the given realm.
FAQs
API interface for the Tozny authentication service, with Passport strategy for easy integration in Express apps
The npm package tozny-auth receives a total of 27 weekly downloads. As such, tozny-auth popularity was classified as not popular.
We found that tozny-auth demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.