Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
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.
diet-auth
Advanced tools
Readme
Dead-simple authentication for diet.js.
npm install diet-auth
Service | Protocol | Scope List |
---|---|---|
OAuth 2.0 | https://developers.facebook.com/docs/facebook-login/permissions/v2.1 | |
OAuth 2.0 | https://developers.google.com/+/api/oauth | |
More services are coming soon. |
// index.js
var server = require('diet')
var app = server()
app.listen('http://localhost:8000/')
var auth = require('diet-auth')(app)
// Setup Auth Service
var facebook = auth('facebook', {
id : 'yourId', // facebook app id
secret : 'yourSecret', // facebook app secret
scope : 'email' // specify facebook scopes
})
// Listen on GET /auth/facebook/redirect
app.get(facebook.redirect, function($){
$($.passed){
$.end('Hello' + $.data.user.first_name + '!')
} else {
$.end('Something went wrong: ' + $.error)
}
})
http://localhost:8000/auth/facebook
will bring up the facebook login page.facebook.redirect
$.passed
is true
then you'll have access to the $.data.user
object that contains every profile information that you requested with the scope.$.passed
is false
then you can see what's wrong in the $.error
method.diet-auth
has a generalised api for all services. The only differences between services is the scope names and the $.data.user
object.
// Setup Auth Service
var yourService = auth.use('yourService', {
id : 'yourServiceId', // service app id
secret : 'yourServiceSecret', // service app secret
scope : 'email' // specify facebook scopes
})
// Listen on GET /auth/yourService/redirect
app.get(yourService.redirect, function($){
$($.passed){
$.end('Hello' + $.data.user.first_name + '!')
} else {
$.end('Something went wrong: ' + $.error)
}
})
Better API documentation
Twitter authorization
Linkedin authorization
Github authorization
Windows Live authorization
Yahoo authorization
Trello authorization
FAQs
Dead-simple authentication for diet.js
The npm package diet-auth receives a total of 5 weekly downloads. As such, diet-auth popularity was classified as not popular.
We found that diet-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.
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.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.