Security News
cURL Project and Go Security Teams Reject CVSS as Broken
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
authentic-service
Advanced tools
This is the service component of Authentic. This will help decode tokens so that you can authenticate users within a microservice.
This is the service component of authentic. This will help decode tokens so that you can authenticate users within a microservice.
var http = require('http')
var Authentic = require('authentic-service')
var auth = Authentic({
server: 'https://auth.scalehaus.io'
})
http.createServer(function (req, res) {
// Step 1: decrypt the token
auth(req, res, function (err, authData) {
if (err) return console.error(err)
// Step 2: if we get an email and it's one we like, let them in!
if (authData && authData.email.match(/@scalehaus\.io$/)) {
res.writeHead(200)
res.end('You\'re in!')
// otherwise, keep them out!
} else {
res.writeHead(403)
res.end('Nope.')
}
})
}).listen(1338)
console.log('Protected microservice listening on port', 1338)
npm install --save authentic-service
This is the main entry point. Accepts an options object and returns a function that can parse and decrypt tokens from http requests.
var auth = Authentic({
server: 'https://auth.scalehaus.io'
})
// auth is now a function that accepts req, res, and a callback
auth(req, res, function(err, authData) { ... })
Authentic()
takes an options object as its first argument, one of them is required:
server
: the url of the authentic-server
, e.g. 'http://auth.yourdomain.com'
Optional:
prefix
: defaults to '/auth'
if you set a custom prefix for your authentic-server
, use that same prefix herecacheDuration
: defaults to 3600000
(1 hour in milliseconds). To minimize latency and requests, this is how long authentic-service
will cache the authentic-server
public key.MIT
FAQs
This is the service component of Authentic. This will help decode tokens so that you can authenticate users within a microservice.
The npm package authentic-service receives a total of 50 weekly downloads. As such, authentic-service popularity was classified as not popular.
We found that authentic-service demonstrated a healthy version release cadence and project activity because the last version was released less than 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
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.