
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
Basic authentication mechanism for Single sign-on
To install basic-sso, simply use npm:
npm install basic-sso --save
const app = require('express')()
const Sso = require('basic-sso')
const sso = Sso('server_unique_app_name', {
prime: 'diffie_hellman_prime',
listen: 8001 // port for key exchange
})
const server = sso.server({
domain: 'foo.com',
cookie: {
secret: 'password',
keylist: ['foo', 'bar'],
name: 'sso_signed',
secure: false,
httpOnly: true
}
})
server.addApp('client', {
redirect: 'http://127.0.0.1:3000/landing'
})
server.strategy('strategy', (username, password, done) => {
const user = User.findByUsername(username)
// Compare password
done(null, user)
})
server.authorizeUser((user, app, done) => {
// if user can access this app
done(null, {
// user info to return to client
})
})
server.serializeUser((user, done) => {
// What to put in the cookie
done(null, user.id)
})
server.deserializeUser((id, done) => {
// Retrive user from cookie
const user = User.findById(id)
done(null, user)
})
// Endpoint to authenticate user
app.get('/auth', server.authenticate(), (req, res, next) => {
// render login page
})
// Endpoint to login user
app.post('/login', server.logIn('strategy'))
const app = require('express')()
const Sso = require('basic-sso')
const sso = Sso('client_unique_app_name', {
prime: 'diffie_hellman_prime',
listen: 8002 // port for key exchange
})
const client = sso.client({
verify: 'verify',
server: {
name: 'server',
host: '127.0.0.1',
port: 3000,
dh_port: 8001,
auth_path: '/auth'
}
})
app.get('/login', (req, res) => {
client.redirectLogIn(res)
})
app.get('/landing', client.landing(), (req, res) => {
console.log(req.user)
})
FAQs
Basic authentication mechanism for Single sign-on
We found that basic-sso 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.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.